Loading...

Line Plots

General

Let’s begin by importing VerticaPy.

import verticapy as vp

Let’s generate a dataset using the following data.

data = vp.vDataFrame({
    "date": [1900, 1950, 2000],
    "Asia": [947, 1402, 3634],
    "Africa": [133, 221, 767],
    "Europe": [408, 547, 729],
    "America": [156, 339, 818],
    "Oceania": [6, 13, 30],
})

In the context of data visualization, we have the flexibility to harness multiple plotting libraries to craft a wide range of graphical representations. VerticaPy, as a versatile tool, provides support for several graphic libraries, such as Matplotlib, Highcharts, and Plotly. Each of these libraries offers unique features and capabilities, allowing us to choose the most suitable one for our specific data visualization needs.

_images/plotting_libs.png

Note

To select the desired plotting library, we simply need to use the set_option function. VerticaPy offers the flexibility to smoothly transition between different plotting libraries. In instances where a particular graphic is not supported by the chosen library or is not supported within the VerticaPy framework, the tool will automatically generate a warning and then switch to an alternative library where the graphic can be created.

Please click on the tabs to view the various graphics generated by the different plotting libraries.

We can switch to using the plotly module.

vp.set_option("plotting_lib", "plotly")

In VerticaPy, creating one or multiple line charts within a single graphic is a straightforward and flexible process. This feature enables you to efficiently visualize and compare multiple datasets or trends, providing you with a powerful tool for gaining insights from your data.

data["Asia"].plot(ts = "date")

Drawing a Spline plot

data["Asia"].plot(ts = "date", kind = "spline")