Plotting Options from File - PeterRochford/SkillMetrics GitHub Wiki
Summary
The SkillMetrics package supports the reading the plotting options for target or Taylor diagrams from an options configuration file instead of via keyword arguments in the function calls (target_diagram
, taylor_diagram
). This capability was added to: 1) reduce the lengthy list of keyword arguments to specify detailed appearance of the diagrams, and 2) make it easier for users to specify plotting options that are commonly used for all their diagrams.
How It Works
To use this feature a Comma Separated Value (CSV) file containing the options and values for the diagram must be provided via the calls to the functions to plot the diagram. For example, for the target diagram this would done using the target_options_file
keyword argument:
sm.target_diagram(sdev,crmsd,ccoef, target_options_file = 'target_option_config.csv')
where target_option_config.csv
contains the information on selected target diagram options. Similarly, for the Taylor diagram one would use
sm.taylor_diagram(sdev,crmsd,ccoef, taylor_options_file = 'taylor_option_config.csv')
where taylor_option_config.csv
contains the information on selected Taylor diagram options.
Note that the user can mix this with other keyword arguments and the latter will override the values specified in the options configuration file. For example,
sm.taylor_diagram(sdev,crmsd,ccoef, taylor_options_file = 'taylor_option_config.csv', markerLabel = label)
will result in the marker labels contained in the label
list variable to be used rather than what is stated for the markerlabel
option in the options configuration file taylor_option_config.csv
. This gives the user the flexibility to independently specify in their main program the marker labels for each diagram, while having all their diagrams use the same values for options such as marker color, etc.
Diagram Options File
A sample option configuration file is available for both the target and Taylor diagrams. The general format is the first KEY
column contains the name of the keyword, the second VALUE
column the value for the keyword, and the third Notes
column a description of the option. The KEY
must match those listed in the Target Diagram Options and Taylor Diagram Options Wiki pages, while the VALUE
must conform to the allowed values for the KEY
. The third Notes
column is ignored and is included to allow the user to insert convenient notes for reference. An example of the format for the contents of a Taylor diagram option configuration file is shown below.
KEY VALUE Notes
alpha 1 blending of symbol face color (0.0 transparent through 1.0 opaque). (Default : 1.0)
axismax 0 maximum for the radial contours
checkstats off Check input statistics satisfy Taylor relationship (Default : 'off')
cmap jet Choice of colormap. (Default : 'jet')
cmap_vmin None minimum range of colormap (Default : None)
cmap_vmax None maximum range of colormap (Default : None)
cmap_marker d maximum range of colormap (Default : None)
cmapzdata data values to use for color mapping of markers, e.g. RMSD or BIAS. (Default empty)
colcor 0, 0, 1 color for correlation coefficient labels (Default : blue)
colscor None if None, considers 'colcor' only
colobs r color for observation labels (Default : magenta)
colrms 0, .6, 0 color for RMS labels (Default : medium green)
colstd 0, 0, 0 color for STD labels (Default : black)
colsstd None if None, considers 'colstd' only
...
widthcor linewidth for correlation coefficient grid lines (Default: .8)
widthobs linewidth for observation grid line (Default: .8)
widthrms linewidth for RMS grid lines (Default: .8)
widthstd linewidth for STD grid lines (Default: .8)
Author
A thank you is given to the author for this time saving contribution.
Kevin Wu, [email protected]