Style¶
All the charting functions return a Chart instance. From this you can change various attributes of the chart, such as ticks, labels, and axes. Only a subset of Plotly’s capabilities are implemented here so if you can’t find something, take a look at the Plotly API. If you think it would be useful for others, it may be good to expose it here. Consider contributing a pull request or letting me know that it would be useful!
-
class
plotlywrapper.Chart(data=None, layout=None, repr_plot=True)[source]¶ Plotly chart base class.
Usually this object will get created by from a function.
-
dict¶ Convert Chart to a dict.
-
height¶ Height of the chart in pixels.
-
legend(visible=True)[source]¶ Make legend visible.
Parameters: visible (bool, optional) – Returns: Return type: Chart
-
save(filename: Union[str, NoneType] = None, show_link: bool = True, auto_open: bool = False, output: str = 'file', plotlyjs: bool = True) → str[source]¶ Save the chart to an html file.
-
show(filename: Union[str, NoneType] = None, show_link: bool = True, auto_open: bool = True, detect_notebook: bool = True) → None[source]¶ Display the chart.
Parameters: - filename (str, optional) – Save plot to this filename, otherwise it’s saved to a temporary file.
- show_link (bool, optional) – Show link to plotly.
- auto_open (bool, optional) – Automatically open the plot (in the browser).
- detect_notebook (bool, optional) – Try to detect if we’re running in a notebook.
-
title¶ Title of the chart.
-
width¶ Width of the chart in pixels.
-
xlabel¶ Xaxis Label.
-
xlabelsize(size)[source]¶ Set the size of the label.
Parameters: size (int) – Returns: Return type: Chart
-
xlim(low, high)[source]¶ Set xaxis limits.
Parameters: - low (number) –
- high (number) –
Returns: Return type:
-
xtickangle(angle)[source]¶ Set the angle of the x-axis tick labels.
Parameters: value (int) – Angle in degrees Returns: Return type: Chart
-
yaxis_left(index=1)[source]¶ Put the yaxis on the left hand side.
Parameters: index (int, optional) – Returns: Return type: Chart
-
yaxis_right(index=1)[source]¶ Put the yaxis on the right hand side.
Parameters: index (int, optional) – Returns: Return type: Chart
-
ylabel¶ Left Yaxis Label.
-
ylabelsize(size, index=1)[source]¶ Set the size of the label.
Parameters: size (int) – Returns: Return type: Chart
-
ylim(low, high, index=1)[source]¶ Set yaxis limits.
Parameters: - low (number) –
- high (number) –
- index (int, optional) –
Returns: Return type:
-
ytickangle(angle, index=1)[source]¶ Set the angle of the y-axis tick labels.
Parameters: - value (int) – Angle in degrees
- index (int, optional) – Y-axis index
Returns: Return type:
-
yticksize(size, index=1)[source]¶ Set the tick font size.
Parameters: size (int) – Returns: Return type: Chart
-
yticktext(labels, index=1)[source]¶ Set the tick labels.
Parameters: labels (array-like) – Returns: Return type: Chart
-
ytickvals(values, index=1)[source]¶ Set the tick values.
Parameters: values (array-like) – Returns: Return type: Chart
-
zlabel¶ Zaxis Label.
-