You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please refer to the attached document for figures.
Figure 1 :
I have been trying to make a boxplot using ggplot a graph representing the edge density in (y axis) per land cover type (x axis) for 3 different moments in time (fill=Year). After adding the data in r, I saw that year was appearing as a numerical variable, therefore I renamed it precising that it is a factor. But when plotting the graph this information is not taken into account, I should have something like Figure 2.
I tried the same kind of graph but per District (so character variable) identified directly as a factor when reading the data, then it works. So what should I do to set the year variable as a factor more than I already did: renaming it by setting it as a factor.
An other thing, as you can see in the attached document figure 3: I get rid of the outliers of the boxplot by plotting them in white...which made them invisible on the white background but how can I do do that more properly...??
The text was updated successfully, but these errors were encountered:
The factor per year should be inserted in the geom_boxplot(aes(colour = Year)) and not as fill in ggplot().
For omitting outliers on plots, use outlier.size = NA in geom_boxplot()
EDIT: additionally you can add geom_boxplot(aes(colour = Year, fill = Year)) to fill the boxes with a colour
Hi all,
Please refer to the attached document for figures.
Figure 1 :
I have been trying to make a boxplot using ggplot a graph representing the edge density in (y axis) per land cover type (x axis) for 3 different moments in time (fill=Year). After adding the data in r, I saw that year was appearing as a numerical variable, therefore I renamed it precising that it is a factor. But when plotting the graph this information is not taken into account, I should have something like Figure 2.
Figure 2:
Figure 3:
Numerical variable to factor in ggplot_issues.docx
I tried the same kind of graph but per District (so character variable) identified directly as a factor when reading the data, then it works. So what should I do to set the year variable as a factor more than I already did: renaming it by setting it as a factor.
An other thing, as you can see in the attached document figure 3: I get rid of the outliers of the boxplot by plotting them in white...which made them invisible on the white background but how can I do do that more properly...??
The text was updated successfully, but these errors were encountered: