Welcome to the
section of the gallery. If you want to know more about this kind of
data-to-viz.com. If you're looking for a simple way to implement it in R and
ggplot2, pick an example below.
It is of importance to understand that a connected scatterplot is basically an hybrid between a scatterplot and a lineplot. Thus, please visit the related section here and here to get more examples, since the techniques used are very similar.
Please note also that 2 types of connected scatterplot exist. The first is simply a lineplot with dots added on top of it. It takes as input 2 numeric variables only. The second shows the relationship between 2 numerical variables across time. It requires 3 numerical variables as input. Confusing? Visit data-to-viz to clarify.
Pretty straightforward once you understood how to build a scatterplot and a lineplot. See the focus on annotation that is handy for the second type of connected scatter (see above).
Connected scatterplots are often used for time series. Remember the R graph gallery offers a dedicated section, with heaps of examples. For instance, here is an interactive chart made with the dygraphs library.
Basic R also allows to build connected scatterplot thanks to the `line()` function. You just need to use the `b` option of the `type` argument. See examples below.
How to add a legend to base R plot
The legend() function allows to add a legend. See how to use it with a list of available customization.
Image on the chart background
The rasterImage function allows to add an image on the background of the chart.
Manage date data
Learn why it is important that your date is recognized at the date format, and how to do so.
The web is full of astonishing R charts made by awesome bloggers. The R graph gallery tries to display some of the best creations and explain how their source code works. If you want to display your work here, please drop me a word or even better, submit a Pull Request!
ggRepel allows to add multiple labels with no overlap automatically. Here is a good looking scatterplot using it!