def
pyplot
cauldron.display.pyplot()
warning
The beautifulSoup4 library needs to be installed to use Pyplot in Cauldron, which is not installed by default. If that library is not installed, an error will be shown instead of the plot.

Creates a matplotlib plot in the display for the specified figure. The size of the plot is determined automatically to best fit the notebook.

Arguments
Required
Optional
figure

Any

The matplotlib figure to plot. If omitted, the currently active figure will be used.

Default Value: 

None

scale

float

The display scale with units of fractional screen height. A value of 0.5 constrains the output to a maximum height equal to half the height of browser window when viewed. Values below 1.0 are usually recommended so the entire output can be viewed without scrolling.

Default Value: 

0.8

clear

bool

Clears the figure after it has been rendered. This is useful to prevent persisting old plot data between repeated runs of the project files. This can be disabled if the plot is going to be used later in the project files.

Default Value: 

True

aspect_ratio

list, tuple

The aspect ratio for the displayed plot as a two-element list or tuple. The first element is the width and the second element the height. The units are "inches," which is an important consideration for the display of text within the figure. If no aspect ratio is specified, the currently assigned values to the plot will be used instead.

Default Value: 

None

Basic Usage
The example below shows how to plot a histogram of data with pyplot. It does not pass any variables to the cd.display.pyplot() call, which uses the current figure for plotting as the default.
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import numpy as np import matplotlib.pyplot as plt import cauldron as cd # Create data to plot mu = 100 sigma = 15 x = mu + sigma * np.random.randn(10000) # Histogram of the data n, bins, patches = plt.hist( x=x, bins=50, facecolor='green', alpha=0.75, density=1, ) plt.xlabel('Smarts') plt.ylabel('Probability') plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$') plt.axis([40, 160, 0, 0.03]) plt.grid(True) cd.display.pyplot()