Lineplot#

import altair_express as alx
from vega_datasets import data
df = data.stocks()

alx.lineplot(data=df,x='date',y='price',color='symbol')

The lineplot() function is used to display the relationship between two variables over a continuous interval (often time). This function creates a line plot where the x-axis represents the interval or time and the y-axis represents the value of the variable. Lineplots work best for detecting change over time.

Parameters#

datapandas dataframe.

The data to visualize as a pandas dataframe.

xstring

The column name of the data to be on the x-axis.

ystring

The column name of the data to be on the y-axis

x_axisalt.Axis() Object or None

The column name of the data to be on the x-axis.

y_axisalt.Axis() Object or None

The column name of the data to be on the y-axis

colorstring

The column name in the dataframe to color the bars by or a valid CSS color to make the line of the chart.

widthint

The width of the chart in pixels.

heightint

The height of the chart in pixels.

effectsEffect Objects

The effects of interactions to be applied to the chart.

Examples#

Interactive Brush#

import altair_express as alx
from vega_datasets import data
df = data.stocks()

#alx.highlight_brush() + alx.lineplot(data=df,x='date',y='price',color='symbol')