![]() ![]() The results from each glass type can be identified by the colour, the marker shape and the line type, making it colourblind-friendly and also suitable to be printed in gray-scale.Back in 2016, I had to prepare my PhD introductory talk and I started using package. The plot shows the means, the standard deviation and the compact letter display for each treatment. This scatterplot is suitable for any presentation and also for written reports. # coloured scatterplot ggplot(data_summary, aes(Temp, mean, color = Glass)) + geom_point( aes( shape = Glass), position= position_dodge( width= 5), alpha= 0.4, size = 3) + geom_line( aes( linetype = Glass), position= position_dodge( width= 5)) + geom_errorbar( aes( ymin=mean -sd, ymax=mean +sd), position= position_dodge( width= 5), width = 5, show.legend = FALSE) + labs( x= "Temperature (˚C)", y= "Light Output") + theme_bw() + theme( = element_blank(), = element_blank()) + theme( legend.position = c( 0.1, 0.7)) + geom_text( aes( label=Tukey), size = 3, position = position_dodge( width= 5), vjust= 1.5, show.legend = FALSE) + scale_x_continuous( breaks= c( 100, 125, 150)) + scale_y_continuous( limits= c( 450, 1450), breaks= seq( 500, 1400, 300)) + scale_color_brewer( palette = "Dark2") If you prefer a video-tutorial, you can watch the tutorial Publication-Quality Scatterplots for Two Factors with ggplot – Two-Way ANOVA with R – tutorial 4 at my YouTube channel. You can download the csv file with the summarised data or you can follow the Two-Way ANOVA in R – Step-by-Step Tutorial to build it. To build the scatterplots, we are going to use the summarised data, with the mean, the standard deviation and the letters indicating significant differences by Tukey’s test (compact letter display). The data 1 presents the results of an experiment conducted to study the influence of the operating temperature (100˚C, 125˚C and 150˚C) and three faceplate glass types (A, B and C) in the light output of an oscilloscope tube. In this tutorial we are going to see how to build a high-quality scatterplot for two explanatory variables. ![]() ![]() Improving the visualisation of the shapes.Customising the x and y limits and axis breaks.Customising the theme and legend position.Avoiding the overlay of the data (position dodge).Using colours and shapes to split the results. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |