Plotting Class
The plotting module of exoSpin:
ExoSpin - Plot Class
@authors : I. Abdoulwahab & P. Palma-Bifani & G. Chauvin & A. Simonnin
- class plot_class.Plot(type_, x, y, xlabel, ylabel, color, title)[source]
Initialize every parameters for the Plot class object.
- Parameters:
type (str) – a string representing the type of plot.
x (numpy.ndarray) – 1D array representing x-values of the plot.
y (numpy.ndarray) – 1D array representing y-values of the plot.
xlabel (str) – a string representing the label of the x-axis.
ylabel (str) – a string representing the label of the y-axis.
color (str) – a string representing the color of the plot.
title (str) – a string representing the titlte of the plot.
- type_
a string representing the type of plot. Possible values : {‘Histogram’,’PDF’}
- Type:
str
- x
1D array representing x-values of the plot.
- Type:
numpy.ndarray
- y
1D array representing y-values of the plot.
- Type:
numpy.ndarray
- xlabel
a string representing the label of the x-axis.
- Type:
str
- ylabel
a string representing the label of the y-axis.
- Type:
str
- color
a string representing the color of the plot.
- Type:
str
- title
a string representing the titlte of the plot.
- Type:
str
- bins
a integer that sets the histogram bins.
- Type:
int
- set_color(new_color)[source]
Set a new color for the plot.
- Parameters:
new_color (str) – a string that represents the new color for the plot.
- Raises:
ValueError – If input and self attribute don’t have the same type.
- set_title(new_title)[source]
Set a new title for the plot.
- Parameters:
new_color (str) – a string that represents the new title for the plot.
- Raises:
ValueError – If input and self attribute don’t have the same type.
- set_x(new_x)[source]
Set a new x-axis for the plot
- Parameters:
new_x (numpy.ndarray) – 1D array that represents the new x-axis for the plot.
- Raises:
ValueError – If input and self attribute don’t have the same type and length.
- set_xlabel(label)[source]
Set a new x-axis label for the plot.
- Parameters:
label (str) – a string that represents the new label for the plot.
- Raises:
ValueError – If input and self attribute don’t have the same type.