doeasyeda.doeasyeda
Module Contents
Functions
|
Creates an area plot using Altair with customizable options. |
|
Creates a histogram using Altair with customizable options. |
|
Creates a scatter plot using Altair with customizable options. |
|
Creates a scatter plot using Altair with customizable options. |
- doeasyeda.doeasyeda.create_area_plot(df, x_col, y_col, color=None, title=None, x_title=None, y_title=None, tooltip=None, interactive=False, width=None, height=None)[source]
Creates an area plot using Altair with customizable options.
- Parameters:
df (pd.DataFrame) – Dataframe containing the data for the area plot.
x_col (str) – The column name to be used for the x-axis.
y_col (str) – The column name to be used for the y-axis.
line (bool, optional) – A flag for overlaying line on top of area marks. Default is false, no lines would be automatically added to area marks.
point (bool, optional) – A flag for overlaying points on top of line or area marks. Default is false, no lines would be automatically added to area marks.
color (str, optional) – The column name to be used for color encoding (default is None).
title (str, optional) – The title of the area plot (default is None).
x_title (str, optional) – The title for the x-axis (default is None).
y_title (str, optional) – The title for the y-axis (default is None).
tooltip (list of str, optional) – List of column names to be used for tooltips (default is None).
interactive (bool, optional) – If True, enables interactive features like zooming and panning (default is False).
width (int, optional) – The width of the chart (default is None).
height (int, optional) – The height of the chart (default is None).
- Returns:
An Altair Chart object representing the area plot.
- Return type:
alt.Chart
Example
>>> data = pd.DataFrame({'year': [2000, 2001, 2002, 2003], ... 'population': [100, 120, 90, 80], ... 'continent': ['North America', 'North America', 'Europe', 'Europe']}) >>> create_area_plot(data, 'year', 'population', color='continent', title='Population Over Time by Continent', ... x_title='Year', y_title='Population')
- doeasyeda.doeasyeda.create_hist_plot(df, x_col, y_col, color=None, title=None, x_title=None, y_title=None, tooltip=None, interactive=False, width=None, height=None)[source]
Creates a histogram using Altair with customizable options.
- Parameters:
df (pd.DataFrame) – Dataframe containing the data for the histogram.
x_col (str) – The column name to be used for the x-axis.
y_col (str) – The column name to be used for the y-axis.
color (str, optional) – The column name to be used for color encoding (default is None).
title (str, optional) – The title of the scatter plot (default is None).
x_title (str, optional) – The title for the x-axis (default is None).
y_title (str, optional) – The title for the y-axis (default is None).
tooltip (list of str, optional) – List of column names to be used for tooltips (default is None).
interactive (bool, optional) – If True, enables interactive features like zooming and panning (default is False).
width (int, optional) – The width of the chart (default is None).
height (int, optional) – The height of the chart (default is None).
- Returns:
An Altair Chart object representing the scatter plot.
- Return type:
alt.Chart
Example
>>> data = pd.DataFrame({'category': ['A', 'A', 'B', 'B', 'C', 'C'], ... 'value': [10, 15, 10, 20, 5, 25]}) >>> create_hist_plot(data, x_col='category', y_col='value', color='category', ... title='Histogram of Values by Category', ... x_title='Category', y_title='Value', interactive=True)
- doeasyeda.doeasyeda.create_line_plot(df, x_col, y_col, size=1, color=None, title=None, x_title=None, y_title=None, tooltip=None, interactive=False, width=None, height=None)[source]
Creates a scatter plot using Altair with customizable options.
- Parameters:
df (pd.DataFrame) – Dataframe containing the data for the line plot.
x_col (str) – The column name to be used for the x-axis.
y_col (str) – The column name to be used for the y-axis.
size (int, optional) – The size of the line plot markers (default is 60).
color (str, optional) – The column name to be used for color encoding (default is None).
title (str, optional) – The title of the line plot (default is None).
x_title (str, optional) – The title for the x-axis (default is None).
y_title (str, optional) – The title for the y-axis (default is None).
tooltip (list of str, optional) – List of column names to be used for tooltips (default is None).
interactive (bool, optional) – If True, enables interactive features like zooming and panning (default is False).
width (int, optional) – The width of the chart (default is None).
height (int, optional) – The height of the chart (default is None).
- Returns:
An Altair Chart object representing the scatter plot.
- Return type:
alt.Chart
Example
>>> data = pd.DataFrame({ ... 'year': [2000, 2001, 2002, 2003], ... 'population': [100, 120, 90, 80], ... 'continent': ['Asia', 'Europe', 'Africa', 'Americas'] ... }) >>> create_line_plot(data, 'year', 'population', size=1, color='continent', ... title='Population Over Time by Continent', ... x_title='Year', y_title='Population', interactive=True)
- doeasyeda.doeasyeda.create_scatter_plot(df, x_col, y_col, size=60, color=None, title=None, x_title=None, y_title=None, tooltip=None, interactive=False, width=None, height=None)[source]
Creates a scatter plot using Altair with customizable options.
- Parameters:
df (pd.DataFrame) – Dataframe containing the data for the scatter plot.
x_col (str) – The column name to be used for the x-axis.
y_col (str) – The column name to be used for the y-axis.
size (int, optional) – The size of the scatter plot markers (default is 60).
color (str, optional) – The column name to be used for color encoding (default is None).
title (str, optional) – The title of the scatter plot (default is None).
x_title (str, optional) – The title for the x-axis (default is None).
y_title (str, optional) – The title for the y-axis (default is None).
tooltip (list of str, optional) – List of column names to be used for tooltips (default is None).
interactive (bool, optional) – If True, enables interactive features like zooming and panning (default is False).
width (int, optional) – The width of the chart (default is None).
height (int, optional) – The height of the chart (default is None).
- Returns:
An Altair Chart object representing the scatter plot.
- Return type:
alt.Chart
Example
>>> data = pd.DataFrame({'gdpPercap': [1000, 2000, 3000, 4000], ... 'lifeExp': [70, 80, 60, 65], ... 'continent': ['Asia', 'Europe', 'Africa', 'Americas']}) >>> create_scatter_plot(data, 'gdpPercap', 'lifeExp', size=60, color='continent', ... title='Life Expectancy vs GDP Per Capita by Continent', ... x_title='GDP Per Capita', y_title='Life Expectancy', interactive=True)