IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 102 forks source link

Small (I hope) corrections and additions needed on ribbon plots in the Graphics > Line Plot dialog #8997

Open rdstern opened 4 months ago

rdstern commented 4 months ago

@MeSophie this is the second button at the top of the dialog, called Linerange. I am using data called LakeHuron from the datasets package, because that is used by tidyverse in showing ribbon plots.

I have used the calculator to get value0 <- value - 1 and value1 = value +1. Here is the dialog:

image

a) In the next option (smooth) there is Add Points as here, and also Add Line. Could there please be Add Line also here. If checked then it adds the geom_line for the y variable, i.e. the first receiver, just like the Add points adds geom point.

b) If you run this, then it gives an error! Correcting will be easy for the following reason.

Press the reset button and then complete as above again, but also tick the Add Points checkbox before you run. That gives the code you need, plus the geom_point. (The error is partly because the code without the geom_point, includes stack-TRUE in the first line, which is not needed I think.)

Note if you return to the dialog after it has run once, and repeat, what worked before, you get the same error.

This is the same problem for the Ribbon and other options, so should be easy to correct for all of them!

I can demonstrate if that would help.

c) A small addition for ribbon option. Please add fill = "grey" to the ribbon parameters. Otherwise it is black!

d) And when the ribbon etc is checked and you do reset, then it still remains enabled. Good if it didn't.

MeSophie commented 3 months ago

@rdstern While trying to figure out part b) of this problem, I noticed something strange with this LakeHuron data. The first time I run the Linerange, it works fine. But the second time the aesthetics are empty and the colour=variable which causes an error. I clicked on reset and tried to run the same dialogue several times then it worked with the Survey data, the error was no longer there. I checked the LakeHuron metadata and saw that the value is a time series. I also tried using the austres data from the datasets and got the same error. I don't know if this is the same problem you mention in part b). For d) I can't seem to get the same anomaly.

image