Skip to content

Implementation Details

Karolis Koncevičius edited this page Oct 17, 2019 · 4 revisions

Working Mechanism

Under the hood this library utilises two hooks implemented in the plot.new() function: before.plot.new and plot.new. Custom functions for changing the list of plotting parameters via par() are appended to those hooks and are executed every time a new plot is created. This in turn forces the selected par() values to be re-set again and again with each plot call, apparently making them permanent.

Design Decisions

Implemented Paramters

Currently 3 types of parameters can be implemented within themes:

  1. A subset of par() arguments that apply to single plots as opposed to multiple plots (like mfrow).
  2. Parameters specifying the border drawn around the plot (parameters starting with rect.)
  3. Palette settings (parameters starting with palette.)

The best way to obtain all available parameters is by inspecting the internal structure of implemented themes like so:

pars <- basethme("clean")

Available Themes

The first 8 colors for all the available themes mimic the colors of the default palette by design. This choice is intentional and allows users to rely on col=1 always being "black" and col=2 always being red, etc. Even when a new theme and palette is chosen.

However the colors after the first 8 positions might be changed within the custom themes. For now color number 9 is always orange while color 10 is brown.

Clone this wiki locally