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:
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:
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:
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:
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:
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:
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:
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:
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: