andy-iskauskas / hmer

An R package for Bayes Linear emulation and history matching.
Other
16 stars 3 forks source link

Legends in `emulator_plot` #4

Open johnpaulgosling opened 2 years ago

johnpaulgosling commented 2 years ago

Some of the plots are providing very busy legends based on intervals. For example, emulator_plot(SIREmulators$ems$nS, ppd = 10) image This could look cleaner if a continuous scale was used. Also, it would useful to have a legend on the multi-facet plots. For example,

emulator_plot(SIREmulators$ems, plot_type = 'imp', ppd = 10,
              targets = SIREmulators$targets,
              fixed_vals = list(aSR = 0.02))

image

andy-iskauskas commented 2 years ago

Legends on these plots has been a nuisance for a while, due to the intricacies of how ggplot handles contour plotting. I expect that there is a nice hack for using a discrete scale in the plot and a continuous scale in the legend which may be straightforward; the multiple plot legends run into problems when, eg, using emulator_plot(ems, plot_type = 'exp') for outputs with wildly different ranges. Suggestions about dealing with this are welcome.

tjmckinley commented 1 year ago

Would this work?

https://eliocamp.github.io/metR/reference/discretised_scale.html