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

Add polar to coord tab in plotting #5331

Closed rdstern closed 4 years ago

rdstern commented 5 years ago

In our plots we currently have a special facility for wind roses. It would be good to be able to do other (simpler) circular plots.

I have finally realised there is no point in looking for special facilities in another package. We can easily get sensible plots with our current system. The one item we need to add is a 3rd checkbox on the Coordinates tab. The label could be: Use polar coordinates. The default is to give coord_polar(start = 0) There could be an option called Starting Angle. This has an up-down from 0 to 2 in steps of 0.1. After the up-down give pi. If 0 (default, then it is given as 0. Otherwise it changes start = value pi) (That's quite nice and clear! There is also a checkbox, default unchecked, with the label Direction Anticlockwise. If unchecked (default) it isn't given. If checked, then add direction = -1 to the coord_polar command.

Here is an example of what we can do now - currently with the script from a bar chart or histogram etc. image

The other "trick" that I assume we can do now already is to be able to set the ylim. The "trick" is ylim(-500,500) in the graph above. We might have to enable this sort of feature in the y-axis for discrete. Let's see that later.

dannyparsons commented 5 years ago

There is lots to do on the coordinates tab as there are many other options, but good to start with something on this.

I think put all this in a "Polar Coordinates" groupbox to make it clear. I suggest the starting angle is a textbox, not a a up/down, to make it simpler and then just have a pi label after it to indicate it is a multiple of pi.

@Ivanluv you worked on this tab before, so you might want to take this up?

Ivanluv commented 5 years ago

Am okay taking this up

dannyparsons commented 4 years ago

@Ivanluv @maxwellfundi this has introduced a serious bug on all the other graphics dialog. Any graphics dialog which does not pass in the new polar functions to the Options sub dialog is crashing when Options is clicked. It's simple to fix just by adding those functions in the same way as on the boxplot dialog. Could you fix this urgently? We may want to "replace" the 0.5.3 release after this fix before it is used by others.

maxwellfundi commented 4 years ago

@dannyparsons Good morning, I will fix this this morning.

rdstern commented 4 years ago

@maxwellfundi that's great. But @dannyparsons has this code been introduced in 0.5.3? That version doesn't have the polar coordinates visible, though there may be code "behind the scenes". So I am not sure that version 0.5.3 needs an immediate update? This is useful to check, because I assume that Version 5.3 will be the version used on the AIMS Cameroon course, at least at the start?

maxwellfundi commented 4 years ago

@rdstern this was merged after the version was made i think. I will still have to replace the current v 5.3 with this one the one with the polar changes.

dannyparsons commented 4 years ago

Ok that's right, it was actually merged after, so v0.5.3 does not have this serious bug, then we don't need to immediately create a new version to replace it.

maxwellfundi commented 4 years ago

This has already been done.