plotnine.themes.theme¶
- class plotnine.themes.theme(complete=False, axis_title_x=None, axis_title_y=None, axis_title=None, legend_title=None, legend_text_legend=None, legend_text_colorbar=None, legend_text=None, plot_title=None, plot_subtitle=None, plot_caption=None, strip_text_x=None, strip_text_y=None, strip_text=None, title=None, axis_text_x=None, axis_text_y=None, axis_text=None, text=None, axis_line_x=None, axis_line_y=None, axis_line=None, axis_ticks_minor_x=None, axis_ticks_minor_y=None, axis_ticks_major_x=None, axis_ticks_major_y=None, axis_ticks_major=None, axis_ticks_minor=None, axis_ticks_x=None, axis_ticks_y=None, axis_ticks=None, panel_grid_major_x=None, panel_grid_major_y=None, panel_grid_minor_x=None, panel_grid_minor_y=None, panel_grid_major=None, panel_grid_minor=None, panel_grid=None, line=None, legend_key=None, legend_background=None, legend_box_background=None, panel_background=None, panel_border=None, plot_background=None, strip_background_x=None, strip_background_y=None, strip_background=None, rect=None, axis_ticks_length_major_x=None, axis_ticks_length_major_y=None, axis_ticks_length_major=None, axis_ticks_length_minor_x=None, axis_ticks_length_minor_y=None, axis_ticks_length_minor=None, axis_ticks_length=None, axis_ticks_pad_major_x=None, axis_ticks_pad_major_y=None, axis_ticks_pad_major=None, axis_ticks_pad_minor_x=None, axis_ticks_pad_minor_y=None, axis_ticks_pad_minor=None, axis_ticks_pad=None, axis_ticks_direction_x=None, axis_ticks_direction_y=None, axis_ticks_direction=None, panel_spacing_x=None, panel_spacing_y=None, panel_spacing=None, plot_margin_left=None, plot_margin_right=None, plot_margin_top=None, plot_margin_bottom=None, plot_margin=None, panel_ontop=None, aspect_ratio=None, dpi=None, figure_size=None, legend_box=None, legend_box_margin=None, legend_box_just=None, legend_direction=None, legend_key_width=None, legend_key_height=None, legend_key_size=None, legend_margin=None, legend_box_spacing=None, legend_spacing=None, legend_position=None, legend_title_align=None, legend_entry_spacing_x=None, legend_entry_spacing_y=None, legend_entry_spacing=None, strip_align_x=None, strip_align_y=None, strip_align=None, subplots_adjust=None, **kwargs)[source]¶
Base class for themes
In general, only complete themes should subclass this class.
- Parameters
- completebool
Themes that are complete will override any existing themes. themes that are not complete (ie. partial) will add to or override specific elements of the current theme. e.g:
theme_gray() + theme_xkcd()
will be completely determined by
theme_xkcd
, but:theme_gray() + theme(axis_text_x=element_text(angle=45))
will only modify the x-axis text.
- kwargs: dict
kwargs are themeables. The themeables are elements that are subclasses of themeable. Many themeables are defined using theme elements i.e
These simply bind together all the aspects of a themeable that can be themed. See
themeable
.
Notes
When subclassing, make sure to call
theme.__init__
. After which you can customiseself._rcParams
within the__init__
method of the new theme. ThercParams
should not be modified after that.