visualization.PlotThemes
visualization.PlotThemes()
Complete plotting theme configurations.
Provides preset themes that combine colors, fonts, templates, and styling for consistent professional visualization.
Attributes
| DEFAULT |
dict |
Standard Plotly white theme |
| PUBLICATION |
dict |
Publication-ready styling (clean, high-contrast) |
| DARK |
dict |
Dark mode theme |
| PRESENTATION |
dict |
Large fonts and high contrast for presentations |
Examples
>>> # Apply theme to figure
>>> fig = plotter.plot_trajectory(t, x)
>>> fig = PlotThemes.apply_theme(fig, theme='publication')
>>> fig.show()
>>>
>>> # Custom theme
>>> custom = PlotThemes.DEFAULT.copy()
>>> custom['font_size'] = 16
>>> fig = PlotThemes.apply_theme(fig, theme=custom)
Methods
apply_theme
visualization.PlotThemes.apply_theme(fig, theme='default')
Apply complete theme to Plotly figure.
Parameters
| fig |
go.Figure |
Plotly figure to style |
required |
| theme |
str or dict |
Theme name (‘default’, ‘publication’, ‘dark’, ‘presentation’) or custom theme dictionary |
'default' |
Examples
>>> # Apply publication theme
>>> fig = plotter.plot_trajectory(t, x)
>>> fig = PlotThemes.apply_theme(fig, theme='publication')
>>> fig.write_html('figure.html')
>>>
>>> # Custom theme
>>> custom = {
... 'template': 'plotly_white',
... 'font_family': 'Helvetica',
... 'font_size': 16,
... }
>>> fig = PlotThemes.apply_theme(fig, theme=custom)
get_line_styles
visualization.PlotThemes.get_line_styles()
Get available line dash patterns.
Returns
|
List[str] |
List of Plotly line dash patterns |
Examples
>>> styles = PlotThemes.get_line_styles()
>>> print(styles)
['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot']