PeterRochford / SkillMetrics

A Python library for calculating and displaying the skill of model predictions against observations.
GNU General Public License v3.0
201 stars 92 forks source link

Error with cmapzdata functionality #45

Open kyle-hinson opened 11 months ago

kyle-hinson commented 11 months ago

Hello,

I appreciate the detailed instructions and examples for this useful package. My question is about plotting using the cmapzdata option, which appears to only correspond to the total RMSD values of a dataset, even when specifying a separate list or array of values. Below I've copied a minimal example from a dataset that I am working with.

Latitude Bias CRMSD RMSD
32 0.3 0.5 0.9
36 0.4 0.6 1.1
40 0.5 1.0 1.5

Below is the code that I am using to plot this small dataset, and the result.

lat = [32, 36, 40]
bias = [0.3, 0.4, 0.5]
crmsd = [0.4, 0.6, 1.1]
rmsd = [0.5, 1.0, 1.5]

sm.target_diagram(np.array(bias),np.array(crmsd),np.array(rmsd),
                  markerDisplayed='colorBar', titleColorbar='Latitude',
                  cmapzdata=lat, cmap='viridis', cmap_marker='o',
                  markersize=35)
cmapzdata_example_1 copy

My issue is that when lat is reversed, I get the exact same results. However, the order of the colors are reversed when the value of rmsd is reversed as well, rather than the user input in the target_diagram function.

I'm a new user to this package, so apologies if I've missed something. Any help is greatly appreciated.