show_discrete_data

odl.util.graphics.show_discrete_data(values, grid, title=None, method='', force_show=False, fig=None, \*\*kwargs)[source]

Display a discrete 1d or 2d function.

Parameters
valuesnumpy.ndarray

The values to visualize.

gridRectGrid or RectPartition

Grid of the values.

titlestring, optional

Set the title of the figure.

methodstring, optional

1d methods:

‘plot’ : graph plot

‘scatter’ : scattered 2d points (2nd axis <-> value)

2d methods:

‘imshow’ : image plot with coloring according to value, including a colorbar.

‘scatter’ : cloud of scattered 3d points (3rd axis <-> value)

‘wireframe’, ‘plot_wireframe’ : surface plot

force_showbool, optional

Whether the plot should be forced to be shown now or deferred until later. Note that some backends always displays the plot, regardless of this value.

figmatplotlib.figure.Figure, optional

The figure to show in. Expected to be of same “style”, as the figure given by this function. The most common usecase is that fig is the return value from an earlier call to this function. Default: New figure

interp{‘nearest’, ‘linear’}, optional

Interpolation method to use. Default: ‘nearest’

axis_labelsstring, optional

Axis labels, default: [‘x’, ‘y’]

update_in_placebool, optional

Update the content of the figure in-place. Intended for faster real time plotting, typically ~5 times faster. This is only performed for method == 'imshow' with real data and fig != None. Otherwise this parameter is treated as False. Default: False

axis_fontsizeint, optional

Fontsize for the axes. Default: 16

colorbarbool, optional

Argument relevant for 2d plots using method='imshow'. If True, include a colorbar in the plot. Default: True

kwargs{‘figsize’, ‘saveto’, …}, optional

Extra keyword arguments passed on to display method See the Matplotlib functions for documentation of extra options.

Returns
figmatplotlib.figure.Figure

The resulting figure. It is also shown to the user.

See also

matplotlib.pyplot.plot

Show graph plot

matplotlib.pyplot.imshow

Show data as image

matplotlib.pyplot.scatter

Show scattered 3d points