Python_2  1.0
Functions | Variables
_04e_boxplot_demo Namespace Reference

A matplotlib example. More...

Functions

def fake_bootstrapper (n)
 plt.show() More...
 

Variables

int spread = np.random.rand(50) * 100
 
int center = np.ones(25) * 50
 
int flier_high = np.random.rand(10) * 100 + 100
 
int flier_low = np.random.rand(10) * -100
 
 data = np.concatenate((spread, center, flier_high, flier_low))
 
 fig
 
 axs
 
 left
 
 right
 
 bottom = -5
 
 top = 40
 
 hspace
 
 wspace
 
 d2 = np.concatenate((spread, center, flier_high, flier_low))
 
 ax
 
list random_dists
 plt.show() More...
 
int N = 500
 
 norm = np.random.normal(1, 1, N)
 
 logn = np.random.lognormal(1, 1, N)
 
 expo = np.random.exponential(1, N)
 
 gumb = np.random.gumbel(6, 4, N)
 
 tria = np.random.triangular(2, 9, 11, N)
 
 bootstrap_indices = np.random.randint(0, N, N)
 
 ax1
 
 figsize
 
 bp = ax1.boxplot(data, notch=0, sym='+', vert=1, whis=1.5)
 
 color
 
 marker
 
 True
 
 linestyle
 
 which
 
 alpha
 
 axisbelow
 
 title
 
 xlabel
 
 ylabel
 
list box_colors = ['darkkhaki', 'royalblue']
 
 num_boxes = len(data)
 
 medians = np.empty(num_boxes)
 
 box = bp['boxes'][i]
 
list box_x = []
 
list box_y = []
 
 box_coords = np.column_stack([box_x, box_y])
 
 med = bp['medians'][i]
 
list median_x = []
 
list median_y = []
 
 markeredgecolor
 
 rotation
 
 fontsize
 
int pos = np.arange(num_boxes) + 1
 
list upper_labels = [str(round(s, 2)) for s in medians]
 
list weights = ['bold', 'semibold']
 
int k = tick % 2
 
 transform
 
 horizontalalignment
 
 size
 
 weight
 
 backgroundcolor
 
float inc = 0.1
 
 e1 = np.random.normal(0, 1, size=500)
 
 e2 = np.random.normal(0, 1, size=500)
 
 e3 = np.random.normal(0, 1 + inc, size=500)
 
 e4 = np.random.normal(0, 1 + 2 * inc, size=500)
 
list treatments = [e1, e2, e3, e4]
 
 med1
 
 ci1
 
 med2
 
 ci2
 
list conf_intervals = [None, None, ci1, ci2]
 
 markersize
 

Detailed Description

A matplotlib example.

Author
Paulo Roma
Since
03/11/2021
See also
https://matplotlib.org/stable/gallery/statistics/boxplot_demo.html#sphx-glr-gallery-statistics-boxplot-demo-py

Function Documentation

◆ fake_bootstrapper()

def _04e_boxplot_demo.fake_bootstrapper (   n)

plt.show()

This is just a placeholder for the user's method of
bootstrapping the median and its confidence intervals.

Returns an arbitrary median and confidence interval packed into a tuple.

Variable Documentation

◆ alpha

_04e_boxplot_demo.alpha

◆ ax

_04e_boxplot_demo.ax

◆ ax1

_04e_boxplot_demo.ax1

◆ axisbelow

_04e_boxplot_demo.axisbelow

◆ axs

_04e_boxplot_demo.axs

◆ backgroundcolor

_04e_boxplot_demo.backgroundcolor

◆ bootstrap_indices

_04e_boxplot_demo.bootstrap_indices = np.random.randint(0, N, N)

◆ bottom

int _04e_boxplot_demo.bottom = -5

◆ box

_04e_boxplot_demo.box = bp['boxes'][i]

◆ box_colors

list _04e_boxplot_demo.box_colors = ['darkkhaki', 'royalblue']

◆ box_coords

_04e_boxplot_demo.box_coords = np.column_stack([box_x, box_y])

◆ box_x

list _04e_boxplot_demo.box_x = []

◆ box_y

list _04e_boxplot_demo.box_y = []

◆ bp

_04e_boxplot_demo.bp = ax1.boxplot(data, notch=0, sym='+', vert=1, whis=1.5)

◆ center

int _04e_boxplot_demo.center = np.ones(25) * 50

◆ ci1

_04e_boxplot_demo.ci1

◆ ci2

_04e_boxplot_demo.ci2

◆ color

_04e_boxplot_demo.color

◆ conf_intervals

list _04e_boxplot_demo.conf_intervals = [None, None, ci1, ci2]

◆ d2

_04e_boxplot_demo.d2 = np.concatenate((spread, center, flier_high, flier_low))

◆ data

list _04e_boxplot_demo.data = np.concatenate((spread, center, flier_high, flier_low))

◆ e1

_04e_boxplot_demo.e1 = np.random.normal(0, 1, size=500)

◆ e2

_04e_boxplot_demo.e2 = np.random.normal(0, 1, size=500)

◆ e3

_04e_boxplot_demo.e3 = np.random.normal(0, 1 + inc, size=500)

◆ e4

_04e_boxplot_demo.e4 = np.random.normal(0, 1 + 2 * inc, size=500)

◆ expo

_04e_boxplot_demo.expo = np.random.exponential(1, N)

◆ fig

_04e_boxplot_demo.fig

◆ figsize

_04e_boxplot_demo.figsize

◆ flier_high

int _04e_boxplot_demo.flier_high = np.random.rand(10) * 100 + 100

◆ flier_low

int _04e_boxplot_demo.flier_low = np.random.rand(10) * -100

◆ fontsize

_04e_boxplot_demo.fontsize

◆ gumb

_04e_boxplot_demo.gumb = np.random.gumbel(6, 4, N)

◆ horizontalalignment

_04e_boxplot_demo.horizontalalignment

◆ hspace

_04e_boxplot_demo.hspace

◆ inc

float _04e_boxplot_demo.inc = 0.1

◆ k

int _04e_boxplot_demo.k = tick % 2

◆ left

_04e_boxplot_demo.left

◆ linestyle

_04e_boxplot_demo.linestyle

◆ logn

_04e_boxplot_demo.logn = np.random.lognormal(1, 1, N)

◆ marker

_04e_boxplot_demo.marker

◆ markeredgecolor

_04e_boxplot_demo.markeredgecolor

◆ markersize

_04e_boxplot_demo.markersize

◆ med

_04e_boxplot_demo.med = bp['medians'][i]

◆ med1

_04e_boxplot_demo.med1

◆ med2

_04e_boxplot_demo.med2

◆ median_x

list _04e_boxplot_demo.median_x = []

◆ median_y

list _04e_boxplot_demo.median_y = []

◆ medians

list _04e_boxplot_demo.medians = np.empty(num_boxes)

◆ N

int _04e_boxplot_demo.N = 500

◆ norm

_04e_boxplot_demo.norm = np.random.normal(1, 1, N)

◆ num_boxes

_04e_boxplot_demo.num_boxes = len(data)

◆ pos

int _04e_boxplot_demo.pos = np.arange(num_boxes) + 1

◆ random_dists

list _04e_boxplot_demo.random_dists
Initial value:
1 = ['Normal(1, 1)', 'Lognormal(1, 1)', 'Exp(1)', 'Gumbel(6, 4)',
2  'Triangular(2, 9, 11)']

plt.show()

◆ right

_04e_boxplot_demo.right

◆ rotation

_04e_boxplot_demo.rotation

◆ size

_04e_boxplot_demo.size

◆ spread

int _04e_boxplot_demo.spread = np.random.rand(50) * 100

◆ title

_04e_boxplot_demo.title

◆ top

int _04e_boxplot_demo.top = 40

◆ transform

_04e_boxplot_demo.transform

◆ treatments

list _04e_boxplot_demo.treatments = [e1, e2, e3, e4]

◆ tria

_04e_boxplot_demo.tria = np.random.triangular(2, 9, 11, N)

◆ True

_04e_boxplot_demo.True

◆ upper_labels

list _04e_boxplot_demo.upper_labels = [str(round(s, 2)) for s in medians]

◆ weight

_04e_boxplot_demo.weight

◆ weights

list _04e_boxplot_demo.weights = ['bold', 'semibold']

◆ which

_04e_boxplot_demo.which

◆ wspace

_04e_boxplot_demo.wspace

◆ xlabel

_04e_boxplot_demo.xlabel

◆ ylabel

_04e_boxplot_demo.ylabel