Graph Elements
Description
Two classes, Graph and GraphPlot, containing the values and formatting of the data to plot on graphs.
Graph
- class classes.graph_element.Graph
Class containing multiple plots (each being a
classes.graph_element.GraphPlot
) to display on the same graph.New in version 2.0.
- Graph.add_plot(x, y, line_width=1.0, color='#000000')
Creates and adds a
classes.graph_element.GraphPlot
element to theplots
attribute.New in version 2.0.
- Parameters:
x (list(float) or numpy.array(float)) – An array of values to plot on the x axis.
y (list(float) or numpy.array(float)) – An array of values to plot on the y axis.
line_width (float, optional) – The width of the line to plot on the graph, in pixels. By default, the line width is 1 pixel.
color (str, optional) – The hexadecimal value of the color of the line, prefixed by a number sign (
#
). By default, the color is black.
- Graph.__repr__()
Returns a textual representation of the content of the Graph element, indicating the number of plots and their respective dimensions.
New in version 2.0.
- Returns:
A string representation of the content of the Graph element, indicating the number of plots and their respective dimensions.
- Return type:
str
GraphPlot
- class classes.graph_element.GraphPlot(x, y, line_width=1.0, color='#000000')
Class containing the data of the x and y axis to plot in a graph, along with display settings such as line width and color.
New in version 2.0.
- Parameters:
x (list(float) or numpy.array(float)) – An array of values to plot on the x axis.
y (list(float) or numpy.array(float)) – An array of values to plot on the y axis.
line_width (float, optional) – The width of the line to plot on the graph, in pixels. By default, the line width is 1 pixel.
color (str, optional) – The hexadecimal value of the color of the line, prefixed by a number sign (
#
). By default, the color is black.
- x
The array of values to plot on the x axis.
- Type:
list(float) or numpy.array(float)
- y
The array of values to plot on the y axis.
- Type:
list(float) or numpy.array(float)
- line_width
The width of the line to plot on the graph, in pixels.
- Type:
float
- color
The hexadecimal value of the color of the line, prefixed by a number sign (
#
).- Type:
str