Composition: comparison

comparison(x, y, f=None, show=False, autocolor=True, top=None, bottom=None, left=None, right=None, wspace=None, hspace=None, **kwargs)

The table below displays the supported numerical input combinations, where:

  • array: List or NumPy array with numerical values

  • […]: List containing …

  • result: <curves>

Table 1 Valid input combinations.

x

y

Result

Notes

array

array

1

array

[array, array]

2

Both y share a single x

[array, array]

[array, array]

2

Both x share a single y

[n*[array]]

[n*[array]]

n

Each y has an x

Arguments are internally classified as figure, plural and curve arguments, namely:

  • Figure

    Select few arguments which may be input only once in the plotting process, so as to avoid conflicts. Ieg: passing grid=True twice (plt.grid(...)) will result in no grid being drawn. These are removed from the keyword arguments and used in the last comparison call.

  • Plural

    Arguments passed with any of the keywords accepted by all 2D plotters -that is, any keyword which does not start with the name of its plotting class-, in plural tense. These must be lists of length equal to the number of curves. Each element in the list is the value of the keyword argument for each curve (eg: passing colors=['red', 'green', 'blue'] to a 3-curve plot will set the color of the curves to ‘red’, ‘green’ and ‘blue’.

  • Curve

    Curve-specific parameters (color, line_width, plot_label)

The limits of the plot will be adjusted to the upper and lower limits of all ``x``s and ``y``s.

Arguments

Parameters
  • x (list of list or list of np.ndarray) – Domains.

  • y (list of list or list of np.ndarray) – Values.

  • f (list of plot) – Functions used to plot y(x)

  • autocolor (bool) – Whether to automatically assign different colors to each curve

  • show (bool) – plt.show() after plotting (thereby finishing the plot)

  • top (float) – plt.subplots_adjust parameter

  • bottom (float) – plt.subplots_adjust parameter

  • left (float) – plt.subplots_adjust parameter

  • right (float) – plt.subplots_adjust parameter

  • wspace (float) – plt.subplots_adjust parameter

  • hspace (float) – plt.subplots_adjust parameter

  • kwargs – MPL Plotter plotting class keyword arguments for further customization