Scatter plots¶
Inherits from PlotChecker
.

class
plotchecker.
ScatterPlotChecker
(axis)[source]¶ A plot checker for scatter plots.
Parameters: axis :
matplotlib.axes.Axes
objectA set of matplotlib axes (e.g. obtained through
plt.gca()
)
assert_num_points
(num_points)[source]¶ Assert that the plot has the given number of points.
Parameters: num_points : int

x_data
¶ The xvalues of the plotted data (1D array).

assert_x_data_equal
(x_data)[source]¶ Assert that the given xdata is equivalent to the plotted
x_data
.Parameters: x_data : 1D arraylike
The expected xdata. The number of elements should be equal to the (expected) number of plotted points.

y_data
¶ The yvalues of the plotted data (1D array).

assert_y_data_equal
(y_data)[source]¶ Assert that the given ydata is equivalent to the plotted
y_data
.Parameters: y_data : 1D arraylike
The expected ydata. The number of elements should be equal to the (expected) number of plotted points.

colors
¶ The colors of the plotted points. Columns correspond to RGB values.

assert_colors_equal
(colors)[source]¶ Assert that the given colors are equivalent to the plotted
colors
.Parameters: colors : single color, or list of expected line colors
Each color can be either a matplotlib color name (e.g.
'r'
or'red'
), a hexcode (e.g."#FF0000"
), a 3tuple RGB color, or a 4tuple RGBA color.

alphas
¶ The alpha values of the plotted points.

assert_alphas_equal
(alphas)[source]¶ Assert that the given alpha values are equivalent to the plotted
alphas
.Parameters: alphas :
The expected alpha values. This should either be a single number (which will apply to all the points) or an array with size equal to the number of (expected) points.

edgecolors
¶ The edge colors of the plotted points. Columns correspond to RGB values.

assert_edgecolors_equal
(edgecolors)[source]¶ Assert that the given edge colors are equivalent to the plotted
edgecolors
.Parameters: edgecolors : single color, or list of expected edge colors
Each color can be either a matplotlib color name (e.g.
'r'
or'red'
), a hexcode (e.g."#FF0000"
), a 3tuple RGB color, or a 4tuple RGBA color.

edgewidths
¶ The edge widths of the plotted points.

assert_edgewidths_equal
(edgewidths)[source]¶ Assert that the given edge widths are equivalent to the plotted
edgewidths
.Parameters: edgewidths :
The expected edge widths. This should either be a single number (which will apply to all the points) or an array with size equal to the number of (expected) points.

sizes
¶ The size of the plotted points. This is the square of
markersizes
.

assert_sizes_equal
(sizes)[source]¶ Assert that the given point sizes are equivalent to the plotted
sizes
.Parameters: sizes :
The expected point sizes. This should either be a single number (which will apply to all the points) or an array with size equal to the number of (expected) points.

assert_markersizes_equal
(markersizes)[source]¶ Assert that the given marker sizes are equivalent to the plotted
markersizes
.Parameters: markersizes :
The expected marker sizes. This should either be a single number (which will apply to all the points) or an array with size equal to the number of (expected) points.

markers
¶ The marker styles of the plotted points. Unfortunately, this information is currently unrecoverable from matplotlib, and so this attribute is not actually implemented.

assert_markers_equal
(markers)[source]¶ Assert that the given marker styles are equivalent to the plotted
markers
.Note: information about marker style is currently unrecoverable from collections in matplotlib, so this method is not actually implemented.
Parameters: markers :
The expected marker styles. This should either be a single style (which will apply to all the points) or an array with size equal to the number of (expected) points.
