andrews_curves module¶
Draw Andrews curves from a Dataset
.
The AndrewsCurves
class implements the Andrew plot, a.k.a. Andrews curves,
which is a way to visualize \(n\) samples of a high-dimensional vector
in a 2D referential by projecting each sample
onto the vector
which is composed of the \(d\) first elements of the Fourier series:
Each curve \(t\mapsto f_i(t)\) is plotted over the interval \([-\pi,\pi]\) and structure in the data may be visible in these \(n\) Andrews curves.
A variable name can be passed to the DatasetPlot.execute()
method
by means of the classifier
keyword
in order to color the curves according to the value of the variable name.
This is useful when the data is labeled.
Classes:
|
Andrews curves. |
- class gemseo.post.dataset.andrews_curves.AndrewsCurves(dataset)[source]¶
Bases:
gemseo.post.dataset.dataset_plot.DatasetPlot
Andrews curves.
Initialize self. See help(type(self)) for accurate signature.
- Parameters
dataset (Dataset) – The dataset containing the data to plot.
- Raises
ValueError – If the dataset is empty.
- Return type
None
Attributes:
The color of the series.
The color map.
The figure size.
The x-component of figure size.
The y-component of figure size.
The font size.
The location of the legend.
The line style of the series.
The paths to the output files.
The maximum value on the r-axis.
The minimum value on the r-axis.
The title of the plot.
The label for the x-axis.
The maximum value on the x-axis.
The minimum value on the x-axis.
The label for the y-axis.
The maximum value on the y-axis.
The minimum value on the y-axis.
The label for the z-axis.
The maximum value on the z-axis.
The minimum value on the z-axis.
Methods:
execute
([save, show, file_path, ...])Execute the post processing.
- COLOR = 'color'¶
- COLORMAP = 'colormap'¶
- FIGSIZE_X = 'figsize_x'¶
- FIGSIZE_Y = 'figsize_y'¶
- LINESTYLE = 'linestyle'¶
- property color¶
The color of the series.
- property colormap¶
The color map.
- execute(save=True, show=False, file_path=None, directory_path=None, file_name=None, file_format=None, properties=None, **plot_options)¶
Execute the post processing.
- Parameters
save (bool) –
If True, save the plot.
By default it is set to True.
show (bool) –
If True, display the plot.
By default it is set to False.
file_path (Optional[Union[str, pathlib.Path]]) –
The path of the file to save the figures. If None, create a file path from
directory_path
,file_name
andfile_format
.By default it is set to None.
directory_path (Optional[Union[str, pathlib.Path]]) –
The path of the directory to save the figures. If None, use the current working directory.
By default it is set to None.
file_name (Optional[str]) –
The name of the file to save the figures. If None, use a default one generated by the post-processing.
By default it is set to None.
file_format (Optional[str]) –
A file format, e.g. ‘png’, ‘pdf’, ‘svg’, … If None, use a default file extension.
By default it is set to None.
properties (Optional[Mapping[str, Union[str, int, float, Sequence[Union[str, int, float]]]]]) –
The general properties of a
DatasetPlot
.By default it is set to None.
**plot_options (Union[str, int, float, bool, Sequence[str]]) – The options of the current class inheriting from
DatasetPlot
.
- Returns
The figures.
- Return type
List[matplotlib.figure.Figure]
- property figsize¶
The figure size.
- property figsize_x¶
The x-component of figure size.
- property figsize_y¶
The y-component of figure size.
- property font_size¶
The font size.
- property legend_location¶
The location of the legend.
- property linestyle¶
The line style of the series.
- property output_files¶
The paths to the output files.
- property rmax¶
The maximum value on the r-axis.
- property rmin¶
The minimum value on the r-axis.
- property title¶
The title of the plot.
- property xlabel¶
The label for the x-axis.
- property xmax¶
The maximum value on the x-axis.
- property xmin¶
The minimum value on the x-axis.
- property ylabel¶
The label for the y-axis.
- property ymax¶
The maximum value on the y-axis.
- property ymin¶
The minimum value on the y-axis.
- property zlabel¶
The label for the z-axis.
- property zmax¶
The maximum value on the z-axis.
- property zmin¶
The minimum value on the z-axis.