ahb108/rcarbon

Feature wish: show decimal places in plot.stackCalSPD multi panel plot

Closed this issue · 3 comments

I'm still working with the stackspd function. It is very useful for comparing SPD's of course. Multipanel has the best display for comparison and I'm trying to adjust arguments to get the most understandable and honest display. Rescale makes all the SPD curves equally visible. But it doesn't show the difference between higher and lower probability curves. Turning it off makes some of the curves nearly flat since all have the same y-scale. Turning on spdnormalize is somewhere in between for visualization. But it loses the y scale because the labels are all rounded to 1 decimal place.

I suggest 2 improvements

  1. Have an option to let the y-scale be set independently for each panel or be the same across all panels (e.g., like in ggplot facet_wrap)
  2. Have an argument to let the user choose how many decimal places to display on the y-scale. This would help on the other plot types too.

I think commit 1b17653 might be what you are looking for. There are two changes. The new argument rnd now sets the number of digits in the y-axis plot, and when setting rescale to TRUE the displayed y-axis for each SPD is now the observed value (rather than 0-1). This means that effectively when rescale=FALSE the SPD is displayed using a common y-axis range (so smaller SPDs would look flat), whilst when rescale=TRUE the y-axis would be different for each. The number of digits for the other plots are not internally controlled by rcarbon so would need to be adjusted using R's option settings. I will close this for now - but if there are any issues/bug please report.

Thanks much for this and #62. I’ll be trying it out soon.

I tried it out. Didn’t test the ordering but the scaling works really well. Thanks. Did it hit any bugs either.