Charts

These are the basic chart types Plotlywrapper supports.

Scatter

line

plotlywrapper.line(x=None, y=None, label=None, color=None, width=None, dash=None, opacity=None, mode='lines+markers', yaxis=1, fill=None, text='', markersize=6)[source]

Draws connected dots.

Parameters:
  • x (array-like, optional) –
  • y (array-like, optional) –
  • label (array-like, optional) –
Returns:

Return type:

Chart

Examples

line(range(1, 6))

scatter

plotlywrapper.scatter(x=None, y=None, label=None, color=None, width=None, dash=None, opacity=None, markersize=6, yaxis=1, fill=None, text='', mode='markers')[source]

Draws dots.

Parameters:
  • x (array-like, optional) –
  • y (array-like, optional) –
  • label (array-like, optional) –
Returns:

Return type:

Chart

Examples

scatter(range(1, 6))

Bar

bar

plotlywrapper.bar(x=None, y=None, label=None, mode='group', yaxis=1, opacity=None)[source]

Create a bar chart.

Parameters:
  • x (array-like, optional) –
  • y (TODO, optional) –
  • label (TODO, optional) –
  • mode ('group' or 'stack', default 'group') –
  • opacity (TODO, optional) –
Returns:

A Chart with bar graph data.

Return type:

Chart

Examples

bar(range(1, 6))

Histogram

hist

plotlywrapper.hist(x, mode='overlay', label=None, opacity=None, horz=False, histnorm=None)[source]

Histogram.

Parameters:
  • x (array-like) –
  • mode (str, optional) –
  • label (TODO, optional) –
  • opacity (float, optional) –
  • horz (bool, optional) –
  • histnorm (None, "percent", "probability", "density", "probability density", optional) – Specifies the type of normalization used for this histogram trace. If None, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If “percent”, the span of each bar corresponds to the percentage of occurrences with respect to the total number of sample points (here, the sum of all bin area equals 100%). If “density”, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin area equals the total number of sample points). If “probability density”, the span of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin area equals 1).
Returns:

Return type:

Chart

Examples

hist(np.sin(np.linspace(0, 2*np.pi, 500)))

hist2d

plotlywrapper.hist2d(x, y, label=None, opacity=None)[source]

2D Histogram.

Parameters:
  • x (array-like, optional) –
  • y (array-like, optional) –
  • label (TODO, optional) –
  • opacity (float, optional) –
Returns:

Return type:

Chart

Examples

hist2d(np.sin(np.linspace(0, 2*np.pi, 100)),
       np.cos(np.linspace(0, 2*np.pi, 100)))

Filled Area

fill_zero

plotlywrapper.fill_zero(x=None, y=None, label=None, color=None, width=None, dash=None, opacity=None, mode='lines+markers', **kargs)[source]

Fill to zero.

Parameters:
  • x (array-like, optional) –
  • y (TODO, optional) –
  • label (TODO, optional) –
Returns:

Return type:

Chart

Examples

bar(range(1, 6))

fill_between

plotlywrapper.fill_between(x=None, ylow=None, yhigh=None, label=None, color=None, width=None, dash=None, opacity=None, mode='lines+markers', **kargs)[source]

Fill between ylow and yhigh.

Parameters:
  • x (array-like, optional) –
  • ylow (TODO, optional) –
  • yhigh (TODO, optional) –
Returns:

Return type:

Chart

Examples

fill_between(range(5), range(1, 6), range(2, 12, 2))

Heatmap

heatmap

plotlywrapper.heatmap(z, x=None, y=None, colorscale='Viridis')[source]

Create a heatmap.

Parameters:
  • z (TODO) –
  • x (TODO, optional) –
  • y (TODO, optional) –
  • colorscale (TODO, optional) –
Returns:

Return type:

Chart

Note: If z is 1D, then you must specify x and y as well. For example, taking a Pandas series with a time index, setting x = series.index.date and y = series.index.time, then z needs to be 1D (e.g. z = series.values). This would plot an empty chart if using a Pandas DataFrame, as df.values will result in an array of [[z1],[z2],[z3]…], which is not 1D.

Examples

heatmap(np.arange(25).reshape(5, -1))
x = np.arange(5)
heatmap(z=np.arange(25), x=np.tile(x, 5), y=x.repeat(5))

3D

plotlywrapper.line3d(x, y, z, label=None, color=None, width=None, dash=None, opacity=None, mode='lines+markers')[source]

Create a 3d line chart.

plotlywrapper.scatter3d(x, y, z, label=None, color=None, width=None, dash=None, opacity=None, mode='markers')[source]

Create a 3D scatter Plot.

Parameters:
  • x (array-like) – data on x-dimension
  • y (array-like) – data on y-dimension
  • z (array-like) – data on z-dimension
  • label (TODO, optional) –
  • mode ('group' or 'stack', default 'group') –
  • opacity (TODO, optional) –
Returns:

Return type:

Chart

plotlywrapper.surface(x, y, z)[source]

Surface plot.

Parameters:
  • x (array-like, optional) –
  • y (array-like, optional) –
  • z (array-like, optional) –
Returns:

Return type:

Chart

Shapes

plotlywrapper.vertical(x, ymin=0, ymax=1, color=None, width=None, dash=None, opacity=None)[source]

Draws a vertical line from ymin to ymax.

Parameters:
  • xmin (int, optional) –
  • xmax (int, optional) –
  • color (str, optional) –
  • width (number, optional) –
Returns:

Return type:

Chart

plotlywrapper.horizontal(y, xmin=0, xmax=1, color=None, width=None, dash=None, opacity=None)[source]

Draws a horizontal line from xmin to xmax.

Parameters:
  • xmin (int, optional) –
  • xmax (int, optional) –
  • color (str, optional) –
  • width (number, optional) –
Returns:

Return type:

Chart

Rug

plotlywrapper.rug(x, label=None, opacity=None)[source]

Rug chart.

Parameters:
  • x (array-like, optional) –
  • label (TODO, optional) –
  • opacity (TODO, optional) –
Returns:

Return type:

Chart