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

Bug in boxplots and problem in summary plot sub-dialogue #7294

Open rdstern opened 2 years ago

rdstern commented 2 years ago

In the boxplots the means may be connected by a line.
image

The code below may enable the bug to be found easily? I used diamonds dataset first, and you can see that the variable clarity is still in the commands below, though I am now using our simple survey data.

# The dialog, Boxplot Options
survey <- data_book$get_data_frame(data_name="survey")
last_graph <- ggplot2::ggplot(data=survey, mapping=ggplot2::aes(y=yield, x=village)) + ggplot2::geom_boxplot(outlier.colour="red") + ggplot2::stat_summary(geom="line", group=1, fun.y="mean", size=1.5, color="blue", mapping=ggplot2::aes(y=x, x=clarity)) + theme_grey() + ggplot2::theme(axis.text.x=ggplot2::element_text())
data_book$add_graph(graph_name="last_graph", graph=last_graph, data_name="survey")
data_book$get_graphs(data_name="survey", graph_name="last_graph")

There is another annoying issue raised by @HawardKetoyoMsatsi earlier. When this works the lines are very broad. Here is the sub-dialogue for summary and the width is ticked, but cannot be edited. I hope this is just possibly the spacing of the controls for stats_summary?

image

I wonder if this could be done quickly by @N-thony with perhaps a little help if needed from @shadrackkibet or @Patowhiz ?

Ivanluv commented 2 years ago

Am having a look at this

Ivanluv commented 2 years ago

There is another annoying issue raised by @HawardKetoyoMsatsi earlier. When this works the lines are very broad. Here is the sub-dialogue for summary and the width is ticked, but cannot be edited. I hope this is just possibly the spacing of the controls for stats_summary?

This seems to be working from my end.

Ivanluv commented 2 years ago

With two data frames loaded eg the survey and the dodoma dataset open the Boxplot dialogue and have the Group to connect checked image

within the Plot Options sub dialogue edit the X and Y aesthetic for the stat_summary geom. image Returning to the boxplot main dialogue and changing the data frame within the selector and updating the variables image from the new dataframes gives the error when Ok is clicked image

@rdstern are this the steps you used to generate the bug?

Ivanluv commented 2 years ago

With two data frames loaded eg the survey and the dodoma dataset open the Boxplot dialogue and have the Group to connect checked image

within the Plot Options sub dialogue edit the X and Y aesthetic for the stat_summary geom. image Returning to the boxplot main dialogue and changing the data frame within the selector and updating the variables image from the new dataframes gives the error when Ok is clicked image

@rdstern are this the steps you used to generate the bug?

If so then ,following the same steps ,this bug might be in all the graphics dialogues that have geoms added within the main dialogue eg in the Bar chart dialogue that has geom_text geom added when the Add Labels check box is checked