Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying ggplot2 Essentials
  • Table Of Contents Toc
ggplot2 Essentials

ggplot2 Essentials

By : Donato Teutonico
3.8 (5)
close
close
ggplot2 Essentials

ggplot2 Essentials

3.8 (5)
By: Donato Teutonico

Overview of this book

This book is perfect for R programmers who are interested in learning to use ggplot2 for data visualization, from the basics up to using more advanced applications, such as faceting and grouping. Since this book will not cover the basics of R commands and objects, you should have a basic understanding of the R language.
Table of Contents (9 chapters)
close
close
8
Index

Saving plots to a file


In this section, we will take a look at the different methods available of saving your plots. Most of these concepts apply to all plots realized in R although we will also consider the ggsave() function that is specific to the ggplot2() package. In R, there are three ways that you can use to save created plots:

  • Saving the plot manually by way of the device window system (could be different between operating systems)

  • Saving the plot to a file without rendering the plot

  • Saving the plot after rendering the plot

We will take a look at the different methods in the upcoming sections. Just keep in mind that when you save a file as a plot, the file with the specified filename will be saved in your working directory. Be careful since, if you already have a file with the same name, it will be overwritten without any warnings from R, so if you run the code in these examples, just verify that your working directory does not contain files with the same name as the plot that we will...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
ggplot2 Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon