Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Scatter Plot

20200822

\includegraphics[width=\textwidth]{figures/onepager/ggplot2:weather_aus_scatter-1}

set.seed(26439)
ds %>%
  sample_n(100) %>%
  ggplot(aes(x=min_temp, y=max_temp)) +
  geom_point() +
  labs(x = vnames["min_temp"],
       y = vnames["max_temp"])

The simplest of plots is a scatter plot which displays a two dimensional plot of points. The dimensions are the x= and y= axes. The observations from the dataset, which are the rows in the dataset, are plotted, scattering the points over the plot.

Using the template variable ds the dataset is piped (tidyr::https://www.rdocumentation.org/packages/tidyr/topics/ggplot2::aes() are set up with min_temp as the x= axis and max_temp as the y= axis. To add the points (observations) to the plot we employ ggplot2::geom_point().


Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.