Skip to content

Chart module

Chart module for creating interactive chart.

bar_plot(data, x, y, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a bar chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def bar_plot(data, x, y, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a bar chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.barplot(data=df, x=x, y=y, hue=hue, **kwargs)

box_plot(data, x, y, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a box chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def box_plot(data, x, y, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a box chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.boxplot(data=df, x=x, y=y, hue=hue, **kwargs)

count_plot(data, x, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to single_count_plot)

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def count_plot(data, x, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to single_count_plot)
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.countplot(data=df, x=x, hue=hue, **kwargs)

point_plot(data, x, y, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to single_point_plot)

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def point_plot(data, x, y, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to single_point_plot)
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.pointplot(data=df, x=x, y=y, hue=hue, **kwargs)

scatter_plot(data, x, y, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a scatter chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def scatter_plot(data, x, y, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a scatter chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.catplot(data=df, x=x, y=y, hue=hue, **kwargs)

set_default_theme(style='darkgrid', **kwargs)

Set the aesthetic style of the plots.

Parameters:

Name Type Description Default
style str

darkgrid, darkgrid, dark, white, ticks

'darkgrid'
kwargs

Additional parameters to control the aesthetics of the grid.

{}
Source code in geomapdemo/chart.py
def set_default_theme(style="darkgrid", **kwargs):
    """Set the aesthetic style of the plots.
    Args:
        style (str): darkgrid, darkgrid, dark, white, ticks
        kwargs: Additional parameters to control the aesthetics of the grid."""
    sns.set_theme(style=style, **kwargs)

single_bar_plot(data, variable, **kwargs)

Plot data and regression model fits across a FacetGrid. Can be used to plot a single bar chart variable.(changable to bar_plot)

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
variable str

Variables that specify positions on the x and y axes.

required
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def single_bar_plot(data, variable, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Can be used to plot a single bar chart variable.(changable to bar_plot)
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        variable (str): Variables that specify positions on the x and y axes.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.barplot(data=df, y=df[variable], **kwargs)

single_box_plot(data, variable, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a single box chart !!! aegs data (DataFrame): CSV file path or DataFrame object. variable (str): Variables that specify positions on the x and y axes. kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

Source code in geomapdemo/chart.py
def single_box_plot(data, variable, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a single box chart
    Aegs:
        data (DataFrame): CSV file path or DataFrame object.
        variable (str): Variables that specify positions on the x and y axes.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.boxplot(data=df, x=df[variable], **kwargs)

single_count_plot(data, variable, **kwargs)

Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to count_plot)

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
variable str

Variables that specify positions on the x and y axes.

required
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def single_count_plot(data, variable, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Can be used to plot a single variable.(changable to count_plot)
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        variable (str): Variables that specify positions on the x and y axes.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.countplot(data=df, x=df[variable], **kwargs)

single_violin(data, variable, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a single violin chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
variable str

Variables that specify positions on the x and y axes.

required
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def single_violin(data, variable, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a single violin chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        variable (str): Variables that specify positions on the x and y axes.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.violinplot(x=df[variable], **kwargs)

violin_plot(data, x, y, hue=None, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a violin chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

None
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def violin_plot(data, x, y, hue=None, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a violin chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.violinplot(data=df, x=x, y=y, hue=hue, **kwargs)

violin_spilt(data, x, y, hue, spilt=True, **kwargs)

Plot data and regression model fits across a FacetGrid. Used to plot a spilt violin chart

Parameters:

Name Type Description Default
data DataFrame

CSV file path or DataFrame object.

required
x, y (str

Variables that specify positions on the x and y axes.

required
hue str

Variable in data to map plot aspects to different colors.

required
spilt bool

Whether to draw half of a violin for each hue level or allow them to overlap.

True
kwargs

Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.

{}
Source code in geomapdemo/chart.py
def violin_spilt(data, x, y, hue, spilt=True, **kwargs):
    """Plot data and regression model fits across a FacetGrid. Used to plot a spilt violin chart
    Args:
        data (DataFrame): CSV file path or DataFrame object.
        x, y (str): Variables that specify positions on the x and y axes.
        hue (str): Variable in data to map plot aspects to different colors.
        spilt (bool): Whether to draw half of a violin for each hue level or allow them to overlap.
        kwargs: Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the joint_kws dictionary.
    """
    if isinstance(data, str):
        df = pd.read_csv(data)
    else:
        df = data
    sns.violinplot(data=df, x=x, y=y, hue=hue, split=spilt, **kwargs)