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

Some Corrections Made on Plotting Sub-dialog and Line Plots #8994

Closed MeSophie closed 2 weeks ago

MeSophie commented 1 month ago

Fixes #8992 Fixes Partially #8997 @rdstern I made some corrections on plotting sub-dialog and line plots. Please have a look. I also notice that if we checked Add Point control on Line, Linerange, or Smooth button, it will be checked for the other two buttons. Do you agree with this? I also fixes part a) and c) of issue #8997

MeSophie commented 1 month ago

@rdstern I added Arrow() on geom_line. From my side the orientation is working well taking from geom parameters.

image

rdstern commented 1 month ago

Very odd that it works on your machine and not on mine.

By the way, there is another oddity when you go to the line sub-dialog. I hope this is on your machine too:

image

Notice the x variable (date) is deleted from the x: - presumably because it doesn't permit date-type variables in the selector. (That is not the case for path or step.), but is also not there for area - though it was there still in the x - which it isn't in the line geom.

I can now see that you have added the arrow stuff. It still does not appear on my machine. Maybe others could also try testing your branch?

@N-thony maybe you could try? and check the coding at the same time?

a) Import economics data from the library - in ggplot2 (or use survey as Sophie does) b) Graphics > Line plot with unemploy as y and date as x. Works fine. (or yield v fert) c) Into Line Plor Plot options. Check Orientation and make it "y". Also arrow and default setting. Do you get arrow and/or orioentation in the code/graph? Sophie does, and I don't. I don't get an error, but just the default as before. The line settings are like this:

image

The code I get is:

image

So in my case the changes in the settings are ignored?

I have updated my master to the latest version?

MeSophie commented 1 month ago

@rdstern We are now on the same page. I was using orientation an arrow() taking fromPLot Options>layers>Layer parameters and it works fine but when we use them from Lines Options>Layer parameters it not working anymore. I will see what is going on.

rdstern commented 1 month ago

@MeSophie that's a relief and good detective work, Sophie. I look forward to the results of your investigation!

rdstern commented 1 month ago

@MeSophie I wonder if this problem has been there a long time - or maybe recently introduced. For example, when I go into the layer parameters I notice the colour is set to blue, but the lines are not blue? And when I set them to red it ignores we in just the same way as your arrows and orientation don't get added. Given it is general, it may be easy to find?

And if you could also look at why Date-type variables are not included in the aestetics athat would be good. The economics dataset from ggplot2 is a possible one to use.

MeSophie commented 1 month ago

@rdstern It takes a bit longer to resolve because I have to rewrite part of the code as none of the parameters taken from the Line Options appear in the script. And it's the same with LineRange Options and maybe for other too?

rdstern commented 1 month ago

@MeSophie I could imagine. I am also finding some problems with ribbon plots that I am about to specify as a separate issue. That's from the main dialog, but after your comment above I'll check the sub-dialog at the same time.

MeSophie commented 4 weeks ago

@rdstern please could you test the new changes?

rdstern commented 3 weeks ago

@MeSophie I started testing, but now realise part of the problem was (maybe is) the fact that some variables were of class ts and not numeric. I am keen to separate the ts problem from the other changes needed in processing the line geom and its relatives. So, for now, I am making a ts variable into numeric first. Once that is solved and the geoms are working, I would like to explore what should be done if someone really wants to do a line plot for a ts variable. I have found that all that needs to happen (I think) is to include as.numeric(value) in the code? So we could explore that. My nervousness is that we may miss out on other classes where the same is needed? However, perhaps if the R command is done explicitely in the analysis code, then perhaps (at least temporarily the user could tweak your R code for a new class?

But let's get it working ok for numeric variables first. I'm testing now.

MeSophie commented 2 weeks ago

@MeSophie I am approving, because this seems an improvement. Do you agree? If so, @N-thony over to you.

I am sure there will be more, for example Date variables don't seem to be allowed in geom line, but they can come in further pull requests.

@rdstern I agree.