Connected Scatterplot





Welcome to the connected scatterplot section of the gallery. If you want to know more about this kind of chart, visit data-to-viz.com. If you're looking for a simple way to implement it in R and ggplot2, pick an example below.

Note on connected scatterplot

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.



Step by step with ggplot2

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 scatterplot for time series

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.

Code of this chart Time series section



Connected scatterplot using base R

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.

🌐 From the web

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!

Related chart types


Scatter
Heatmap
Correlogram
Bubble
Connected scatter
Density 2d