![]() ![]() ![]() You can keep playing around with the window size until you find something that works for you. But also watch out if you make the figure too small, because you might receive an error about the figure margins being too large to fit the figure itself.įor example, if I set the window to be 1 inch by 1 inch and then try to run the plot code, the console says Error in plot.new() : figure margins too large When you’re assigning values to height and width, you should generally use values ranging from 1 to 10. This creates at best a very unappealing visual, and at worst a figure that is very hard to read or interpret in the first place. My biggest pet peeve is the common tendency of saving figures with a size that is way too big relative to the font and point size. For example, it’s quite clear that the smaller 4x4 figure looks a bit better, aesthetically speaking, than the 7x7. If you don’t specify a height or width, the default size for quartz() is height = 7 and width = 7, measured in inches as you can see in the image above, our h = 4 and w = 4 Quartz window is much smaller than the default behind it.īut notice that the font sizes and other graphical elements such as line widths or point sizes remain the same size! This is why it’s important to prototype the sizing. # Set a standard plot size quartz(h = 4, w = 4) If you run quartz(), it will open up a blank graphics device window like this one: You can do this using the quartz() function on a Mac. Then I begin prototyping the different sizing and aspect ratio of the figure by writing out the width and height right in the code until I find something that I like. So the general workflow that I use for creating figures is to first create something that looks more or less good in the viewer window. As a result, it can be hard to come up with figures that have consistent and correct sizing and proportions, especially if you’re making several figures that need to have consistent sizing. If you drag the size of that viewer, you can make the plot have whatever proportions you want. In other words, your figure is plotted in, and conforms to, the Viewer tab in R Studio. When we just create a plot like this in R Studio, the visual proportions of the plot aren’t set automatically. # Create the plot plot(weight ~ group, data = PlantGrowth, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |