quick_anomaly_detector.data_process.graph_scatter
- quick_anomaly_detector.data_process.graph_scatter(df, x_column, y_column, color_column)
Create a scatter plot with color mapping based on a column of a DataFrame.
- Parameters:
df (pandas.DataFrame) – The pandas DataFrame containing the data.
- Returns:
The generated scatter plot figure.
- Return type:
matplotlib.figure.Figure
- Raises:
ValueError – If one or more specified columns do not exist in the DataFrame.
Example:
from quick_anomaly_detector.data_process import graph_scatter df = pd.DataFrame({'x_column': [1, 2, 3], 'y_column': [4, 5, 6], 'color_column': ['red', 'blue', 'green']}) fig = graph_scatter(df, 'x_column', 'y_column', 'color_column') plt.show()
Note
Ensure that the DataFrame contains the required columns for plotting.