Psyplot plugins

psyplot only provides the abstract framework on how to make the interactive visualization and data analysis. The real work is implemented in plugins to this framework. Each plugin is a separate package that has to be installed independent of psyplot and each plugin registers new plot methods for psyplot.project.plot.

Existing plugins

psy_simple.plugin

A psyplot plugin for simple visualization tasks. This plugin provides a bases for all the other plugins

psy_maps.plugin

A psyplot plugin for visualizing data on a map

psy_reg.plugin

A psyplot plugin for visualizing and calculating regression fits

If you have new plugins that you think should be included in this list, please do not hesitate to open an issue on the github project page of psyplot or implement it by yourself in this file and make a pull request.

Note

Because psyplot plugins are imported right at the startup time of psyplot but nevertheless use the psyplot.config.rcsetup.RcParams class, you always have to import psyplot first if you want to load a psyplot plugin. In other words, if you want to import one of the above mentiond modules manually, you always have to type

import psyplot
import PLUGIN_NAME.plugin

instead of

import PLUGIN_NAME.plugin
import psyplot

where PLUGIN_NAME is any of psy_simple, psy_maps, etc.

How to exclude plugins

The psyplot package loads all plugins right when the psyplot is imported. In other words, the statement

import psyplot

already includes that all the psyplot plugin packages are loaded.

You can however exclude plugins from the automatic loading via the PSYPLOT_PLUGINS environment variable and exclude specific plot methods of a plugin via the PSYPLOT_PLOTMETHODS variable.

The PSYPLOT_PLUGINS environment variable

This environment variable is a :: separated string with plugin names. If a plugin name is preceded by a no:, this plugin is excluded. Otherwise, only this plugin is included.

To show this behaviour, we can use psyplot --list-plugins which shows the plugins that are used. By default, all plugins are included

In [1]: !psyplot --list-plugins
- plugin = psy_simple.plugin
- plugin = psy_maps.plugin

Excluding psy-maps works via

In [2]: !PSYPLOT_PLUGINS=no:psy_maps.plugin psyplot --list-plugins
- plugin = psy_simple.plugin

Including only psy-maps works via

In [3]: !PSYPLOT_PLUGINS='yes:psy_maps.plugin' psyplot --list-plugins
- plugin = psy_maps.plugin

The PSYPLOT_PLOTMETHODS environment variable

The same principle is used when the plot methods are loaded from the plugins. If you want to manually exclude a plot method from loading, you include it via no:<plugin-module>:<plotmethod>. For example, to exclude the :attr:mapplot <psy_maps:psyplot.project.plot.mapplot> plot method from the psy-maps plugin, you can use

In [4]: !PSYPLOT_PLOTMETHODS=no:psy_maps.plugin:mapplot psyplot --list-plot-methods
barplot: Make a bar plot of one-dimensional data
combined: Plot a 2D scalar field with an overlying vector field
density: Make a density plot of point data
fldmean: Calculate and plot the mean over x- and y-dimensions
lineplot: Make a line plot of one-dimensional data
mapcombined: Plot a 2D scalar field with an overlying vector field on a map
mapvector: Plot a 2D vector field on a map
plot2d: Make a simple plot of a 2D scalar field
vector: Make a simple plot of a 2D vector field
violinplot: Make a violin plot of your data

and the same if you only want to include the :attr:mapplot <psy_maps:psyplot.project.plot.mapplot> and the :attr:lineplot <psy_simple:psyplot.project.plot.lineplot> methods

In [5]: !PSYPLOT_PLOTMETHODS='yes:psy_maps.plugin:mapplot::yes:psy_simple.plugin:lineplot' psyplot --list-plot-methods
lineplot: Make a line plot of one-dimensional data
mapplot: Plot a 2D scalar field on a map