scatter.py
| FUNCTION | DESCRIPTION |
|---|---|
plot_scatter |
Generates a scatter plot showing the relationship two key variables in the provided survey DataFrame: |
plot_scatter
plot_scatter(df, **kwargs)
Generates a scatter plot showing the relationship two key variables in the provided survey DataFrame: pleasantness_score (X-axis), and presence_score (Y-axis)
This function allows users to customise plot parameters though **kwargs
| PARAMETER | DESCRIPTION |
|---|---|
df
|
A DataFrame containing survey data. It must include at least the columns
TYPE:
|
**kwargs
|
Additional keyword arguments to override default plotting parameters, including:
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
fig
|
The Matplotlib figure object of the generated plot.
TYPE:
|
ax
|
The corresponding axes object containing the scatter plot.
TYPE:
|
Examples:
>>> import pandas as pd
>>> from smellscapy.databases.DataExample import load_example_data
>>> from smellscapy.surveys import validate
>>> from smellscapy.calculations import calculate_presence, calculate_pleasantness
>>> from smellscapy.plotting import plot_scatter
>>> df = load_example_data()
>>> df, excl_df = validate(df)
>>> df = calculate_presence(df)
>>> df = calculate_pleasantness(df)
>>> fig, ax = plot_scatter(df, point_color="steelblue", point_size=50)
Source code in src/smellscapy/plotting/scatter.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |