expyplot v1.1.3 Expyplot.Plot

This is the end-user API for pyplot.

See the matplotlib.plot docs at: http://matplotlib.org/api/pyplot_api.html

Most of these functions are UNTESTED. I know. That's terrible. But you can test them by using them! Then, if they don't work, open an issue on the github: https://github.com/MaxStrange/expyplot/issues

Or better yet, you could write some tests or a patch and open a pull request!

Also, since the return values are simply the string representations of whatever was returned to the python server, all of the return values will need to be converted into actual Elixir datastructures. I would love to get around to changing this behavior in the future, but for now, it is as it is. This also means that numpy arrays that are returned are likely to be truncated.

This documentation is mostly just copied from the matplotlib.plot docs, and much of it isn't translated to Elixir like it should be.

Link to this section Summary

Functions

Annotate the point xy with text s.

Autoscale the axis view to the data (toggle).

Set the default colormap to autumn and apply to current image if any. See help(colormaps) for more information

Add an axes to the figure.

Add a horizontal span (rectangle) across the axis.

This is how axis has been implemented in this library: as two functions - a get and a set, rather than just the one Convenience method to get or set axis properties.

This is how axis has been implemented in this library: as two functions - a get and a set, rather than just the one Convenience method to get or set axis properties.

Add a vertical span (rectangle) across the axes.

Plot a 2-D field of barbs.

Set the default colormap to bone and apply to current image if any.

Clear the current axes.

Label a contour plot.

Clear the current figure.

Set the color limits of the current image.

Close a figure window.

This is a do-nothing function to provide you with help on how matplotlib handles colors.

Set the default colormap to cool and apply to current image if any.

Set the default colormap to copper and apply to current image if any.

Remove an axes from the current figure. If ax doesn't exist, an error will be raised.

Redraw the current figure.

Adds a non-resampled image to the figure.

Place a legend in the figure.

Add text to figure.

Plot filled polygons.

Set the default colormap to flag and apply to current image if any.

Get the current Axes instance on the current figure matching the given keyword args, or create one.

Get a reference to the current figure.

Get the current colorable artist. Specifically, returns the current ScalarMappable instance (image or patch collection), or "Nothing" if no images or patch collections have been defined. The commands imshow() and figimage() create Image instances, and the commands pcolor() and scatter() create Collection instances. The current image is an attribute of the current axes, or the nearest earlier axes in the current figure that contains an image.

Return a list of existing figure labels.

Return a list of existing figure numbers.

Get a sorted list of all of the plotting commands.

This will wait for n clicks from the user and return a list of the coordinates of each click.

Set the default colormap to gray and apply to current image if any.

Set the default colormap to hot and apply to current image if any.

Set the default colormap to hsv and apply to current image if any.

Read an image from a file into an array.

Save an array as an image file.

Set the default colormap to inferno and apply to current image if any.

Turn interactive mode off.

Turn interactive mode on.

Return status of interactive mode.

Set the default coormap to jet and apply to current image if any.

Places a legend on the axes.

Make a plot with log scaling on both the x and y axis.

Set the default colormap to magma and apply to current image if any.

Set or retrieve autoscaling margins.

Display an array as a matrix in a new figure window.

Remove minor ticks from the current plot.

Set the default colormap to nipy_spectral and apply to current image if any.

Pause for interval seconds.

Create a pseudocolor plot of a 2-D array.

Plot a quadrilateral mesh.

Set the default colormap to pink and apply to current image if any.

Set the default colormap to plasma and apply to current image if any.

Plot lines and/or markers to the Axes. args is a variable length argument, allowing for multiple x, y pairs with an optional format string.

make a polar plot.

Set the default colormap to prism and apply to current image if any.

Plot a 2-D field of arrows.

Add a key to a quiver plot.

Set the current rc params. Group is the grouping for the rc.

Restore the default rc params. These are not the params loaded by the rc file, but mpl's internal params. See rc_file_defaults for reloading the default params from the rc file.

Get or set the radial gridlines on a polar plot.

Save the current figure.

Make a plot with log scaling on the x axis.

Make a plot with log scaling on the y axis.

Set the default colormap. Applies to the current image if any.

Display a figure.

Set the default colormap to spectral and apply to current image if any.

Set the default colormap to spring and apply to current image if any.

Draws a stacked area plot.

Create a stem plot.

Return a subplot axes positioned by the given grid definition.

Create a subplot in a grid. The grid is specified by shape, at location of loc, spanning rowspan, colspan cells in each direction. The index for loc is 0-based.

Launch a subplot tool window for a figure.

Set the default colormap to summer and apply to current image if any.

Add a centered title to the figure.

Add a table to the current axes.

Get or set the theta locations of the gridlines in a polar plot.

Change the appearance of ticks and tick labels.

Change the ScalarFormatter used by default for linear axes.

Automatically adjust subplot parameters to give specified padding.

Set a title of the current axes.

Draw contours on an unstructured triangular grid tricontour() and tricontourf() draw contour lines and filled contours, respectively.

Draw contours on an unstructured triangular grid tricontour() and tricontourf() draw contour lines and filled contours, respectively.

Create a pseudocolor plot of an unstructured triangular grid.

Draw an unstructured triangular grid as lines and/or markers.

Make a second axes that shares the x-axis. The new axes will overlay ax (or the current axes if ax is nil). The ticks for ax2 will be placed on the right, and the ax2 instance is returned.

Make a second axes that shares the y-axis. The new axis will overlay ax (or the current axes if ax is nil). The ticks for ax2 will be placed on the top, and the ax2 instance is returned.

Uninstalls the matplotlib display hook.

Set the default colormap to viridis and apply to current image if any.

Blocking call to interact with the figure.

Set the default colormap to winter and apply to current image if any.

Turns xkcd sketch-style drawing mode. This will only have effect on things drawn after this function is called.

Set the x axis label of the current axis.

Get or set the x limits of the current axes.

Set the scaling of the x-axis.

Get or set the x-limits of the current tick locations and labels.

Set the y-axis label of the current axis.

Get or set the y-limits of the current axes.

Set the scaling of the y-axis.

Get or set the y-limits of the current tick locations and labels.

Link to this section Functions

Link to this function

acorr(x, opts \\ [hold: nil, data: nil], kwargs \\ [])

Plot the autocorrelation of x.

Link to this function

angle_spectrum(x, opts \\ [_Fs: 2, _Fc: 0, pad_to: nil, sides: :default], kwargs \\ [])

Plot the angle spectrum.

Compute the angle spectrum (wrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window Not used yet in Expyplot is applied to the signal.

Example call:

1..1_000_000 |> Enum.to_list |> Expyplot.Plot.angle_spectrum(x, [_Fs: 2, _Fc: 0, pad_to: nil, sides: "default"])
Link to this function

annotate(opts \\ [], kwargs \\ [])

Annotate the point xy with text s.

Additional kwargs are passed to Text.

Link to this function

arrow(x, y, dx, dy, opts \\ [hold: nil], kwargs \\ [])

Add an arrow to the axes.

Draws arrow on specified axis from (x, y) to (x + dx, y + dy). Uses FancyArrow patch to construct the arrow.

Link to this function

autoscale(opts \\ [enable: true, axis: :both, tight: nil])

Autoscale the axis view to the data (toggle).

Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or axes.

Set the default colormap to autumn and apply to current image if any. See help(colormaps) for more information

Link to this function

axes(opts \\ [], kwargs \\ [])

Add an axes to the figure.

The axes is added at position rect specified by:

  • axes() by itself creates a default full subplot(111) window axis.
  • axes(rect, [facecolor: :w]), where rect = [left, bottom, width, height] in normalized (0, 1) units. facecolor is the background color for the axis, default white.
  • axes(h) where h is an axes instance makes h the current axis.
Link to this function

axhline(opts \\ [y: 0, xmin: 0, xmax: 1, hold: nil], kwargs \\ [])

Add a horizontal line across the axis.

Typical calls:

Expyplot.Plot.axhline(linewidth: 4, color: :r)           # Draw a thick red hline at 'y'=0 that spans the xrange
Expyplot.Plot.axhline(y: 1)                              # Draw a default hline at 'y'=1 that spans the xrange
Expyplot.Plot.axhline(y: 0.5, xmin: 0.25, xmax: 0.75)    # Draw a default hline at 'y'=0.5 that spans the middle half of the xrange
Link to this function

axhspan(ymin, ymax, opts \\ [xmin: 0, xmax: 1, hold: nil], kwargs \\ [])

Add a horizontal span (rectangle) across the axis.

Draw a horizontal span (rectangle) from ymin to ymax. With the default values of xmin = 0 and xmax = 1, this always spans the xrange, regardless of the xlim settings, even if you change them, e.g., with the set_xlim() command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the y location is in data coordinates.

Link to this function

axis_get(kwargs \\ [])

This is how axis has been implemented in this library: as two functions - a get and a set, rather than just the one Convenience method to get or set axis properties.

This function is of limited usefulness at this stage, as it simply returns the string representation of the current axis.

iex> Expyplot.Plot.axis_get()
"(0.0, 1.0, 0.0, 1.0)"
Link to this function

axis_set(v, kwargs \\ [])

This is how axis has been implemented in this library: as two functions - a get and a set, rather than just the one Convenience method to get or set axis properties.

Some examples:

iex> Expyplot.Plot.axis_set("off")  # Turn off the axis lines and labels
"(0.0, 1.0, 0.0, 1.0)"

iex> Expyplot.Plot.axis_set("equal") # Changes limits of x and y axis so that equal increments of x and y have the same length
"(-0.055, 0.055, -0.055, 0.055)"
Link to this function

axvline(opts \\ [x: 0, ymin: 0, ymax: 1, hold: nil], kwargs \\ [])

Add a vertical line across the axes.

Examples

  • Draw a thick read vline at x = 0 that spans the yrange:
  Expyplot.Plot.axvline(linewidth: 4, color: :r)
  • Draw a default vline at x = 1 that spans the yrange:
  Expyplot.Plot.axvline(x: 1)
  • Draw a default vline at x = 0.5 that spans the middle half of the yrange
  Expyplot.Plot.axvline(x: 0.5, ymin: 0.25, ymax: 0.75)
Link to this function

axvspan(xmin, xmax, opts \\ [ymin: 0, ymax: 1, hold: nil], kwargs \\ [])

Add a vertical span (rectangle) across the axes.

Draw a vertical span (rectangle) from xmin to xmax. With the default values of ymin = 0 and ymax = 1. This always spans the yrange, regardless of the ylim settings, even if you change them, e.g., with the set_ylim() command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the y location is in data coordinates.

Examples

Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the axes.

iex> Expyplot.Plot.axvspan(1.25, 1.55, facecolor: :g, alpha: 0.5)
""
Link to this function

bar(left, height, opts \\ [width: 0.8, bottom: nil, hold: nil, data: nil], kwargs \\ [])

Make a bar plot.

Make a bar plot with rectangles bounded by: left, left + width, bottom, bottom + height (left, right, bottom and top edges).

Link to this function

barbs(opts \\ [], kwargs \\ [])

Plot a 2-D field of barbs.

Link to this function

barh(bottom, width, opts \\ [height: 0.8, left: nil, hold: nil], kwargs \\ [])

Make a horizontal bar plot.

Make a horizontal bar plot with rectangles bounded by: left, left + width, bottom, bottom + height

(lft, right, bottom and top edges).

bottom, width, height, and left can be either scalars or sequences

Set the default colormap to bone and apply to current image if any.

Link to this function

boxplot(x, opts \\ [notch: nil, sym: nil, vert: nil, whis: nil, positions: nil, widths: nil, patch_artist: nil, bootstrap: nil, usermedians: nil, conf_intervals: nil, meanline: nil, showmeans: nil, showcaps: nil, showbox: nil, showfliers: nil, boxprops: nil, labels: nil, flierprops: nil, medianprops: nil, meanprops: nil, capprops: nil, whiskerprops: nil, manage_xticks: true, autorange: false, zorder: nil, hold: nil, data: nil])

Make a box and whisker plot.

Make a box and whisker plot for each column of x or each vector in sequence x. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers.

Link to this function

broken_barh(xranges, yrange, opts \\ [hold: nil, data: nil], kwargs \\ [])

Plot horizontal bars.

A collection of horizontal bars spanning yrange with a sequence of xranges.

Clear the current axes.

Link to this function

clabel(cs, opts \\ [], kwargs \\ [])

Label a contour plot.

Clear the current figure.

Link to this function

clim(opts \\ [vmin: nil, vmax: nil])

Set the color limits of the current image.

To apply clim to all axes images do:

clim(vmin: 0, vmax: 0.5)

If either vmin or vmax is nil, the image min/max respectively will be used for color scaling.

Link to this function

close(opts \\ [])

Close a figure window.

close() by itself closes the current figure

close(num) closes figure number num

close(name) where name is a string, closes figure with that label

close(:all) closes all the figure windows

Link to this function

cohere(x, y, opts \\ [nfft: 256, _Fs: 2, _Fc: 0, noverlap: 0, pad_to: nil, sides: :default, scale_by_freq: nil, hold: nil, data: nil], kwargs \\ [])

Plot the coherence between x and y.

Plot the coherence between x and y. Coherence is the normalized cross spectral density.

Link to this function

colorbar(opts \\ [mappable: nil, cax: nil, ax: nil], kwargs \\ [])

Add a colorbar to a plot.

This is a do-nothing function to provide you with help on how matplotlib handles colors.

Link to this function

contour(opts \\ [], kwargs \\ [])

Plot contours.

contour() and contourf() draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions.

contourf() differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to contour().

Link to this function

contourf(opts \\ [], kwargs \\ [])

Plot contours.

contour() and contourf() draw contour lines and filled contours, respectively. Except as noted, function signatures and return values are the same for both versions.

contourf() differs from the MATLAB version in that it does not draw the polygon edges. To draw edges, add line contours with calls to contour().

Set the default colormap to cool and apply to current image if any.

Set the default colormap to copper and apply to current image if any.

Link to this function

csd(x, y, opts \\ [nfft: 256, _Fs: 2, _Fc: 0, noverlap: 0, pad_to: nil, sides: :default, scale_by_freq: nil, return_line: nil], kwargs \\ [])

Plot the cross-spectral density.

Link to this function

delaxes(opts \\ [])

Remove an axes from the current figure. If ax doesn't exist, an error will be raised.

Redraw the current figure.

This is used to update a figure that has been altered, but not automatically re-drawn. If interactive mode is on (ion()), this should be only rarely needed, but there may be ways to modify the state of a figure without marking it as stale.

Link to this function

errorbar(x, y, opts \\ [yerr: nil, xerr: nil, fmt: "", ecolor: nil, elinewidth: nil, capsize: nil, barsabove: false, lolims: false, uplims: false, xlolims: false, xuplims: false, errorevery: 1, capthick: nil, hold: nil, data: nil], kwargs \\ [])

Plot an errorbar graph.

Plot x versus y with error deltas in yerr and xerr. Vertical errorbars are plotted if yerr is not nil. Horizontal errorbars are plotted if xerr is not nil.

x, y, xerr, and yerr can all be scalars, which plots a single error bar at x, y.

Link to this function

eventplot(positions, opts \\ [orientation: :horizontal, lineoffsets: 1, linelengths: 1, linewidths: nil, colors: nil, linestyles: :solid, hold: nil, data: nil], kwargs \\ [])

Plot identical parallel lines at specific positions.

Plot parallel lines at the given positions. positions should be a 1D or 2D array-like object, with each row corresponding to a row or column of lines.

This type of plot is commonly used in neuroscience for representing neural events, where it is commonly called a spike raster, dot raster, or raster plot.

However, it is useful in any situation where you wish to show the timing or position of multiple sets of discrete events, such as the arrival times of people to a business on each day of the month or the date of hurricanes each year of the last century.

Link to this function

figimage(opts \\ [], kwargs \\ [])

Adds a non-resampled image to the figure.

Link to this function

figlegend(handles, labels, loc, kwargs \\ [])

Place a legend in the figure.

Link to this function

fignum_exists(num)

Link to this function

figtext(opts \\ [], kwargs \\ [])

Add text to figure.

Add text to figure at location x, y (relative 0-1 coords).

Link to this function

figure(opts \\ [num: nil, figsize: nil, dpi: nil, facecolor: nil, edgecolor: nil, frameon: true], kwargs \\ [])

Creates a new figure.

Link to this function

fill(opts \\ [], kwargs \\ [])

Plot filled polygons.

Link to this function

fill_between_horizontal(y, x1, opts \\ [x2: 0, where: nil, step: nil, hold: nil, data: nil], kwargs \\ [])

Make filled polygons between two horizontal curves.

Link to this function

fill_between_vertical(x, y1, opts \\ [y2: 0, where: nil, interpolate: false, step: nil, hold: nil, data: nil], kwargs \\ [])

Make filled polygons between two curves.

Link to this function

findobj(opts \\ [o: nil, match: nil, include_self: true])

Find artist objects.

Recursively find all Artist instances contained in self.

Set the default colormap to flag and apply to current image if any.

Link to this function

gca(kwargs \\ [])

Get the current Axes instance on the current figure matching the given keyword args, or create one.

Get a reference to the current figure.

Get the current colorable artist. Specifically, returns the current ScalarMappable instance (image or patch collection), or "Nothing" if no images or patch collections have been defined. The commands imshow() and figimage() create Image instances, and the commands pcolor() and scatter() create Collection instances. The current image is an attribute of the current axes, or the nearest earlier axes in the current figure that contains an image.

Link to this function

get_current_fig_manager()

Link to this function

get_figlabels()

Return a list of existing figure labels.

Return a list of existing figure numbers.

Link to this function

get_plot_commands()

Get a sorted list of all of the plotting commands.

Link to this function

ginput(opts \\ [], kwargs \\ [])

This will wait for n clicks from the user and return a list of the coordinates of each click.

If timeout is zero or negative, does not timeout.

If n is zero or negative, accumulated clicks until a middle click (or potentially both mouse buttons at once) terminates the input.

Right clicking cancels last input.

The buttons used for the various actions (adding points, removing points, terminating the inputs) can be overriden via the arguments mouse_add, mouse_pop and mouse_stop, that give the associated mouse button: 1 for left, 2 for middle, 3 for right.

The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key terminates input and any other key (not already used by the window manager) selects a point.

Set the default colormap to gray and apply to current image if any.

Link to this function

grid(opts \\ [b: nil, which: :major, axis: :both], kwargs \\ [])

Turn the axes grids on or off.

Set the axes grids on or off; b is a boolean. (For MATLAB compatibility, b may also be an atom :on or :off.)

Link to this function

hexbin(x, y, opts \\ [c: nil, gridsize: 100, bins: nil, xscale: :linear, yscale: :linear, extent: nil, cmap: nil, norm: nil, vmin: nil, vmax: nil, alpha: nil, linewidths: nil, edgecolors: :none, mincnt: nil, marginals: false, hold: nil, data: nil], kwargs \\ [])

Make a hexagonal binning plot.

Make a hexagonal binning plot of x versus y, where x, y are 1-D sequences of the same length, N. If C is nil (the default), this is a histogram of the number of occurrences of the observations at (x[i], y[i]).

If C is specified, it specifies values at the coordinate (x[i], y[i]). These values are accumulated for each hexagonal bin and then reduced according to reduce_C_function, which defaults to numpy's mean function (np.mean). (If C is specified, it must also be a 1-D sequence of the same length as x and y.)

Link to this function

hist(x, opts \\ [bins: nil, range: nil, normed: false, weights: nil, cumulative: false, bottom: nil, histtype: :bar, align: :mid, orientation: :vertical, rwidth: nil, log: false, color: nil, label: nil, stacked: false, hold: nil, data: nil], kwargs \\ [])

Plot a histogram.

Compute and draw the histogram of x. The return value is a tuple (n, bins, patches) or ([n0, n1, ...], bins, [patches0, patches1, ...]) if the input contains multiple data.

Multiple data can be provided via x as a list of datasets of potentially different length, or as a 2-D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form.

Masked arrays are not supported at present.

Link to this function

hist2d(x, y, opts \\ [bins: 10, range: nil, normed: false, weights: nil, cmin: nil, cmax: nil, hold: nil, data: nil], kwargs \\ [])

Make a 2D histogram plot.

Link to this function

hlines(y, xmin, xmax, opts \\ [colors: :k, linestyles: :solid, label: "", hold: nil, data: nil], kwargs \\ [])

Plot horizontal lines at each y from xmin to xmax.

Set the default colormap to hot and apply to current image if any.

Set the default colormap to hsv and apply to current image if any.

Link to this function

imread(opts \\ [], kwargs \\ [])

Read an image from a file into an array.

fname may be a string path, or a valid URL.

If format is provided, will try to read file of that type, otherwise the format is deduced from the filename. If nothing can be deduced, PNG is tried.

Return value is a numpy.array But in expyplot, this will return a string, and it probably won't work. For grayscale images, the return array is MxN. For RGB images, the return value is MxNx4.

matplotlib can only read PNGs natively, but if PIL is installed, it will use it to load the image and return an array (if possible) which can be used with imshow(). Note, URL strings may not be compatible with PIL. Check the PIL documentation for more information.

Link to this function

imsave(opts \\ [], kwargs \\ [])

Save an array as an image file.

The output formats available depend on the backend being used.

Link to this function

imshow(x, opts \\ [cmap: nil, norm: nil, aspect: nil, interpolation: nil, alpha: nil, vmin: nil, vmax: nil, origin: nil, extent: nil, shape: nil, filternorm: 1, filterrad: 4.0, imlim: nil, resample: nil, url: nil, hold: nil, data: nil], kwargs \\ [])

Display an image on the axes.

Set the default colormap to inferno and apply to current image if any.

Turn interactive mode off.

Turn interactive mode on.

Link to this function

isinteractive()

Return status of interactive mode.

Set the default coormap to jet and apply to current image if any.

Link to this function

legend(opts \\ [], kwargs \\ [])

Places a legend on the axes.

Link to this function

locator_params(opts \\ [axis: :both, tight: nil], kwargs \\ [])

Control behavior of tick locators.

Link to this function

loglog(opts \\ [], kwargs \\ [])

Make a plot with log scaling on both the x and y axis.

loglog() supports all the keyword arguments of plot() and matplotlib.axes.Axes.set_xscale() / matplotlib.axes.Axes.set_yscale().

Set the default colormap to magma and apply to current image if any.

Link to this function

magnitude_spectrum(x, opts \\ [_Fs: nil, _Fc: nil, window: nil, pad_to: nil, sides: nil, scale: nil, hold: nil, data: nil], kwargs \\ [])

Plot the magnitude spectrum.

Link to this function

margins(opts \\ [], kwargs \\ [])

Set or retrieve autoscaling margins.

Link to this function

matshow(a, opts \\ [fignum: nil], kwargs \\ [])

Display an array as a matrix in a new figure window.

The origin is set at the upper left hand corner and rows (first dimension of the array) are displayed horizontally. The aspect ratio of the figure window is that of the array, unless this would make an excessively short or narrow figure.

Tick labels for the xaxis are placed on top.

Link to this function

minorticks_off()

Remove minor ticks from the current plot.

Link to this function

nipy_spectral()

Set the default colormap to nipy_spectral and apply to current image if any.

Link to this function

pause(interval)

Pause for interval seconds.

If there is an active figure it will be updated and displayed, and the GUI event loop will run during the pause.

If there is no active figure, or if a non-interactive backend is in use, this executes time.sleep(interval).

This can be used for crude animation.

Link to this function

pcolor(opts \\ [], kwargs \\ [])

Create a pseudocolor plot of a 2-D array.

Link to this function

pcolormesh(opts \\ [], kwargs \\ [])

Plot a quadrilateral mesh.

Link to this function

phase_spectrum(x, opts \\ [_Fs: nil, _Fc: nil, window: nil, pad_to: nil, sides: nil, hold: nil, data: nil], kwargs \\ [])

Plot the phase spectrum.

Link to this function

pie(x, opts \\ [explode: nil, labels: nil, colors: nil, autopct: nil, pctdistance: 0.6, shadow: false, labeldistance: 1.1, startangle: nil, radius: nil, counterclock: true, wedgeprops: nil, textprops: nil, center: {0, 0}, frame: false, hold: nil, data: nil])

Plot a pie chart.

Make a pie chart of array x. The fractional area of each wedge is given by x / sum(x). If sum(x) <= 1, then the values of x give the fractional area directly and the array will not be normalized. The wedges are plotted counterclockwise, by default starting from the x-axis.

Set the default colormap to pink and apply to current image if any.

Set the default colormap to plasma and apply to current image if any.

Link to this function

plot(opts \\ [], kwargs \\ [])

Plot lines and/or markers to the Axes. args is a variable length argument, allowing for multiple x, y pairs with an optional format string.

Each of the following is legal:

x = 1..10 |> Enum.to_list
y = 11..20 |> Enum.to_list
Expyplot.Plot.plot([x, y])          # plot x and y using default line style and color
Expyplot.Plot.plot([x, y, "bo"])    # plot x and y using blue circle markers
Expyplot.Plot.plot([y])             # plot y using x as index array 0..N-1
Expyplot.Plot.plot([y, "r+"])       # ditto, but with red plusses

x2 = 1..5 |> Enum.to_list
y2 = 3..7 |> Enum.to_list
Expyplot.Plot.plot([x, y, "g^", x2, y2, "g-"])

Due to the differences between function signatures in Python and Elixir, the typical usage of this function is a little different than what you would expect:

iex> Expyplot.Plot.plot([[1, 2, 3, 4, 5]])
nil

or

iex> Expyplot.Plot.plot([1..5])
nil

Notice the nesting of the list or range.

Examples with keyword args

Expyplot.Plot.plot([[1, 2, 3], [1, 2, 3], "go-"], label: "line 1", linewidth: 2)
Expyplot.Plot.plot([[1, 2, 3], [1, 4, 9], "rs"], label: "line 2")
Expyplot.Plot.axis_set([0, 4, 0, 10])  # Notice that this signature is 'axis_set', not 'axis' as in matplotlib
Expyplot.Plot.legend()
Link to this function

plot_date(x, y, opts \\ [fmt: :o, tz: nil, xdate: true, ydate: false, hold: nil, data: nil], kwargs \\ [])

A plot with data that contains dates.

Link to this function

plotfile(fname, opts \\ [cols: {0}, plotfuncs: nil, comments: "#", skiprows: 0, checkrows: 5, delimiter: ",", names: nil, subplots: true, newfig: true], kwargs \\ [])

Plot the data in a file.

Link to this function

polar(opts \\ [], kwargs \\ [])

make a polar plot.

Set the default colormap to prism and apply to current image if any.

Link to this function

psd(x, opts \\ [nfft: nil, _Fs: nil, _Fc: nil, detrend: nil, window: nil, noverlap: nil, pad_to: nil, sides: nil, scale_by_freq: nil, return_line: nil, hold: nil, data: nil], kwargs \\ [])

Plot the power spectral density.

Link to this function

quiver(opts \\ [], kwargs \\ [])

Plot a 2-D field of arrows.

Link to this function

quiverkey(opts \\ [], kwargs \\ [])

Add a key to a quiver plot.

Link to this function

rc(opts \\ [], kwargs \\ [])

Set the current rc params. Group is the grouping for the rc.

Restore the default rc params. These are not the params loaded by the rc file, but mpl's internal params. See rc_file_defaults for reloading the default params from the rc file.

Link to this function

rgrids(opts \\ [], kwargs \\ [])

Get or set the radial gridlines on a polar plot.

Link to this function

savefig(opts \\ [], kwargs \\ [])

Save the current figure.

Link to this function

scatter(x, y, opts \\ [s: nil, c: nil, marker: nil, cmap: nil, norm: nil, vmin: nil, vmax: nil, alpha: nil, linewidths: nil, verts: nil, edgecolors: nil, hold: nil, data: nil], kwargs \\ [])

Make a scatter plot of x vs y.

Marker size is scaled by s and marker color is mapped to c.

Link to this function

semilogx(opts \\ [], kwargs \\ [])

Make a plot with log scaling on the x axis.

Link to this function

semilogy(opts \\ [], kwargs \\ [])

Make a plot with log scaling on the y axis.

Set the default colormap. Applies to the current image if any.

cmap must be the name of a registered colormap.

Link to this function

show(opts \\ [], kwargs \\ [])

Display a figure.

Link to this function

specgram(x, opts \\ [nfft: nil, _Fs: nil, _Fc: nil, detrend: nil, window: nil, noverlap: nil, cmap: nil, xextent: nil, pad_to: nil, sides: nil, scale_by_freq: nil, mode: nil, scale: nil, vmin: nil, vmax: nil, hold: nil, data: nil], kwargs \\ [])

Plot a spectrogram.

Set the default colormap to spectral and apply to current image if any.

Set the default colormap to spring and apply to current image if any.

Link to this function

spy(z, opts \\ [precision: 0, marker: nil, markersize: nil, aspect: :equal], kwargs \\ [])

Plot the sparsity pattern on a 2-D array.

spy(z) plots the sparsity pattern of the 2-D array z.

Link to this function

stackplot(x, opts \\ [], kwargs \\ [])

Draws a stacked area plot.

Link to this function

stem(opts \\ [], kwargs \\ [])

Create a stem plot.

Link to this function

step(x, y, opts \\ [], kwargs \\ [])

Make a step plot.

Link to this function

streamplot(x, y, u, v, opts \\ [density: 1, linewidth: nil, color: nil, cmap: nil, norm: nil, arrowsize: 1, arrowstyle: "-|>", minlength: 0.1, transform: nil, zorder: nil, start_points: nil, hold: nil, data: nil])

Draws streamlinkes of a vector flow.

Link to this function

subplot(opts \\ [], kwargs \\ [])

Return a subplot axes positioned by the given grid definition.

Link to this function

subplot2grid(shape, loc, opts \\ [rowspan: 1, colspan: 1], kwargs \\ [])

Create a subplot in a grid. The grid is specified by shape, at location of loc, spanning rowspan, colspan cells in each direction. The index for loc is 0-based.

Link to this function

subplot_tool(opts \\ [targetfig: nil], kwargs \\ [])

Launch a subplot tool window for a figure.

Link to this function

subplots(opts \\ [nrows: 1, ncols: 1, sharex: false, sharey: false, squeeze: true, subplot_kw: nil, gridspec_kw: nil], kwargs \\ [])

Create a figure and a set of subplots.

This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call.

Link to this function

subplots_adjust(opts \\ [], kwargs \\ [])

Tune the subplot layout.

Set the default colormap to summer and apply to current image if any.

Link to this function

suptitle(opts \\ [], kwargs \\ [])

Add a centered title to the figure.

Link to this function

table(kwargs \\ [])

Add a table to the current axes.

Link to this function

text(x, y, s, opts \\ [fontdict: nil, withdash: false], kwargs \\ [])

Add text to the axes.

Add text in string s to axis at location x, y data coordinates.

Link to this function

thetagrids(opts \\ [], kwargs \\ [])

Get or set the theta locations of the gridlines in a polar plot.

If no arguments are passed, return a tuple (lines, labels) where lines is an array of radial gridlines (Line2D instances) and labels is an array of tick labels (Text instances).

Link to this function

tick_parameters(opts \\ [axis: :both], kwargs \\ [])

Change the appearance of ticks and tick labels.

Link to this function

ticklabel_format(kwargs \\ [])

Change the ScalarFormatter used by default for linear axes.

Link to this function

tight_layout(opts \\ [pad: 1.08, h_pad: nil, w_pad: nil, rect: nil])

Automatically adjust subplot parameters to give specified padding.

Link to this function

title(s, opts \\ [], kwargs \\ [])

Set a title of the current axes.

Set one of hte three available axes titles. The available titles are positioned above the aces in the center, flush with the left edge, and flush with the right edge.

Link to this function

tricontour(opts \\ [], kwargs \\ [])

Draw contours on an unstructured triangular grid tricontour() and tricontourf() draw contour lines and filled contours, respectively.

Link to this function

tricontourf(opts \\ [], kwargs \\ [])

Draw contours on an unstructured triangular grid tricontour() and tricontourf() draw contour lines and filled contours, respectively.

Link to this function

tripcolor(opts \\ [], kwargs \\ [])

Create a pseudocolor plot of an unstructured triangular grid.

Link to this function

triplot(opts \\ [], kwargs \\ [])

Draw an unstructured triangular grid as lines and/or markers.

Link to this function

twinx(opts \\ [ax: nil])

Make a second axes that shares the x-axis. The new axes will overlay ax (or the current axes if ax is nil). The ticks for ax2 will be placed on the right, and the ax2 instance is returned.

Link to this function

twiny(opts \\ [ax: nil])

Make a second axes that shares the y-axis. The new axis will overlay ax (or the current axes if ax is nil). The ticks for ax2 will be placed on the top, and the ax2 instance is returned.

Link to this function

uninstall_repl_displayhook()

Uninstalls the matplotlib display hook.

Link to this function

violinplot(dataset, opts \\ [positions: nil, vert: true, widths: 0.5, showmeans: false, showextrema: true, showmedians: false, points: 100, bw_method: nil, hold: nil, data: nil])

Make a violin plot.

Make a violin plot for each column of dataset or each vector in sequence dataset. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, and the maximum.

Set the default colormap to viridis and apply to current image if any.

Link to this function

vlines(x, ymin, ymax, opts \\ [colors: :k, linestyles: :solid, label: "", hold: nil, data: nil], kwargs \\ [])

Plot vertical lines.

Plot vertical lines at each x from ymin to ymax.

Link to this function

waitforbuttonpress(opts \\ [], kwargs \\ [])

Blocking call to interact with the figure.

This will return "True" if a key was pressed, "False" if a mouse button was pressed and "None" if timeout was reached without either being pressed.

If timeout is negative, does not timeout.

Set the default colormap to winter and apply to current image if any.

Link to this function

xcorr(x, y, opts \\ [normed: true, usevlines: true, maxlags: 10, hold: nil, data: nil], kwargs \\ [])

Plot the cross correlation between x and y.

Link to this function

xkcd(opts \\ [scaled: 1, length: 100, randomness: 2], kwargs \\ [])

Turns xkcd sketch-style drawing mode. This will only have effect on things drawn after this function is called.

For best results, the "Humor Sans" font should be indstalled: it is not included with matplotlib.

Link to this function

xlabel(s, opts \\ [], kwargs \\ [])

Set the x axis label of the current axis.

Link to this function

xlim(opts \\ [], kwargs \\ [])

Get or set the x limits of the current axes.

Link to this function

xscale(opts \\ [], kwargs \\ [])

Set the scaling of the x-axis.

Link to this function

xticks(opts \\ [], kwargs \\ [])

Get or set the x-limits of the current tick locations and labels.

Link to this function

ylabel(s, opts \\ [], kwargs \\ [])

Set the y-axis label of the current axis.

Link to this function

ylim(opts \\ [], kwargs \\ [])

Get or set the y-limits of the current axes.

Link to this function

yscale(opts \\ [], kwargs \\ [])

Set the scaling of the y-axis.

Link to this function

yticks(opts \\ [], kwargs \\ [])

Get or set the y-limits of the current tick locations and labels.