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 Colour

20180603

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

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

A key variable in the rattle::weatherAUS dataset is rain_tomorrow. By colouring the dots according to the rain_tomorrow we may see a relationship in the data.

The colour is added simply by specifying a further aesthetic, colour=rain_tomorrow. This results in the different values of the variable rain_tomorrow being coloured differently.


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.