# Is it a good idea to connect data points on a plot to increase readability in slides?

I have a graph of points from a set of experiments, that I want to present on a slide.

The important information in the graph is both the values of the points, and more significantly, that the green points are above the blue points.

It is quick and easy to get my plotting framework (matplotlib) to connect each point to the next:

It should be fairly clear to anyone that the relationship between points is not expected to be linear.

I thought I could want to put the line in to make it clear that one is below the other. It can be hard to see the point markers on the projector screen.

Is this a good idea? Does showing plots this way enhance the visibility of the them for presenting, or does the fact the that lines themselves are fairly meaningless distract too much?

### Audience concerns:

The whole presentation is for graduating engineering students and must be simple. While they would normally have the capacity to deal with complicated plots, the content of the presentation is complicated enough that I don’t want to distract them with anything that might waste thought time. I have already rejected the box-and-whiskers plot as too complicated; this is a plot of the mean values of that data.

• This question appears to be off-topic because it is about data visualisation, not academia. This could be migrated to Cross Validated – EnergyNumbers Sep 22 '14 at 9:27
• It is about the best way to present slides to a audience. I believe it is on-topic for both. (Though I am fine if it is migrated). I suggest perhaps there are additional concerns that would be addressed on accadmia that would not be the focus on CV. Such as old dim projectors, colour-blindness of audience member etc. While these could be considered on CV, that are at the forefront of people minds here on academia – Lyndon White Sep 22 '14 at 9:35
• Having been through the "data visualization in academic context is on topic?" discussion already on this question (which is even less specific to academia, and where the "Leave Open" votes were a definite majority), it seems this is perfectly on topic. – ff524 Sep 22 '14 at 9:37
• If anything, the question would be a good fit for Graphic Design. – Raphael Sep 22 '14 at 10:54
• If you do add lines, please do NOT spline-ify them. I've seen some horrible fitted curves generated, which misrepresent the underlying data. – Carl Witthoft Sep 23 '14 at 14:06

### Concerning the general question

Yes, it is acceptable to connect points, even if only discrete data points exist in theory and there is no continuum. If there is reason to expect that somebody misinterpretes your visualisation due to this or if you can expect the audience to be picky about this, add the sentence (on the slide or spoken):

Lines are for eye guidance only.

• As already remarked, the colours are not well chosen (and will probably look even worse when projected). I recommend to use colours with a strong contrast, for example a white or almost white background and for the data 1) black or almost black, 2) pure red. (Be careful about pure green though, since most projectors will screw it up – dark green is better.)
• Depending on how important you consider certain things:
• Use a logarithmic scale (or similar) for the abscissa (x-axis). This way points do not cluster that much for small x and will be easier to read.
• Use a logarithmic scale for the ordinate (y-axis). This way, the exponential relationship you mentioned becomes apparent immediately. However, the points for small x will get even closer to each other.
• If only discrete points can exist, a line is a bad idea because it implies that intermediate values would be valid. If only discrete points were measured it is a good idea. From your first line I can't quite tell which you meant, but I suspect that you and I disagree... – Floris Sep 22 '14 at 22:40
• @Floris: Yes, we disagree on that. I do not deny the risk of misleading someone, though, and recommend to take countermeasures, if it is any likely that this happens. – Wrzlprmft Sep 23 '14 at 8:11
• @Floris I disagree. In some contexts it may be valid (a line does not always represent extrapolation - sometimes it can represent connection). See for example Parallel Coordinates syntagmatic.github.io/parallel-coordinates. – Piotr Migdal Sep 25 '14 at 9:36
• @PiotrMigdal - interesting tool. Note that in that case there is a clearly labeled categorical axis and the intention of the lines is explicitly to link - since the categories have independent Y axes (number of cylinders, displacement, etc.) which removes all possibility of interpreting the line as "intermediate points may exist and would have this most likely value". – Floris Sep 25 '14 at 14:33

Drawing the lines implies a continuous relationship between the parameters. So if you can expect continuity, then connecting the points is fine. A second point to make is to avoid colours that are as similar as the green and blue you have chosen. One reason the difference is hard to see in the first scatter plot is due to colour. Try to experiment with colours that contrast better and your problem may be solved by just altering colours for one or both of the data sets.

• In addition to colours, you can also choose different markers (triangles and circles, for example). Assuming at some point the figure is published as black and white, the different markers will provide the distinguishing information. – jayann Sep 22 '14 at 9:00
• @jayann The OP states clearly that this is about presentation slides which will be shown in color. So as long as you choose colors that most people can distinguish (think of color-blind folks!) I'd go with a single shape; plots with many shapes often look messy. – Raphael Sep 22 '14 at 10:33
• Perhaps it would be better to use different line styles (solid/dashed). – g.kov Sep 22 '14 at 11:02
• And test the colours on a projector before you give the presentation! The blue and green you've used here are not only likely to be hard to distinguish but also hard to see at all. – David Richerby Sep 22 '14 at 14:20
• I do expect continuity and monotonicity (infact I guarantee monotonicity), i do not expect linear interpolation to be very accurate except towards the right end. Thus you are saying it is fine in this case. Are you saying it is Good in this case, or just "not bad". New colours are Blue and Red (and a third line in a orange) – Lyndon White Sep 23 '14 at 14:30

You say you want to compare your data sets qualitatively, that is make clear which is "better". Since they seem to follow similar functions and are close together, normalisation can be a good tool.

Consider, for instance, this plot:

Note how the defaults of Mathematica 10 end up creating a far clearer plot.

Knowing both functions are basically 1/√n you can multiply the value by, say, n:

Now the "winner" is more clear.

Similar effects can be achieved by (other) axis transformations, cut-offs, zooms, etc. You have to be transparent about what transformations you apply, though, because you can easily end up with a plot that says "A is thrice as good as B!" even though the real difference was miniscule.

• I quote the question (bold by me): “The important information in the graph is both the values of the points, and more significantly, that the green points are below the blue points.” – Wrzlprmft Sep 22 '14 at 11:06
• @Wrzlprmft I read "more significantly". Since, when it comes down to it, a plot can not be expected to support more than one story at once, I decided to focus on the (apparently) more significant point the OP is trying to make. (Also, people tend to overestimate the importance of the values they get.</snark>) – Raphael Sep 22 '14 at 11:08
• Point taken, though using too many plots (and thus switching plots too often) is also negative. – Wrzlprmft Sep 22 '14 at 11:18
• @Wrzlprmft Definitely! My advice would be "skrew the numbers, nobody cares!" in most cases. (If your presentation is about the energy of the Higgs boson, everybody cares.) It all depends on the story you want to tell; I find most stories that focus on showing lists of (allegedly) impressive numbers or formulae quite boring. But ymmv, obviously. – Raphael Sep 22 '14 at 11:35
• Excellent point "let one picture make one point". I see that violated frequently. – Floris Sep 26 '14 at 14:38

I'm going to bring particle physics practice to the table and say never connect-the-dots. Nor should you run splines through data. Run meaningful fits through the data or nothing.

These rules reflect the understanding in that discipline that individual points can have significant error or uncertainty associated with them, and the reader needs to see the data in toto without focusing on individual anomalies. If you know the data can't have these issues then relaxing these rules probably doesn't cause a lot of harm.

So what can you do.

1. Use more visually distinguished markers. A combination of shape, fill and color (with as color-blind friendly a palette as you can of course) gives the reader several ways to hook into the difference.

2. Use a different plotting (normalized, anomaly from theory, linearization of power-laws, etc). This is what Raphael suggested. Finding these can be a bit of an art.

3. If you have a well justified theory (or even a good seat of the pants model), draw fit lines: those automatically reflect the whole data set (good!).

Some points on the basic drawing of your figure.

1. Ditch the gray background. It only makes the data harder to read and makes Tufte cry.

2. Using filled circles for both series is a way to cause maximum visual confusion.

For display purposes, a smooth curve is the most logical thing to use. There are some nice spline fitting routines that allow you to create a fit that can be constrained to minimize curvature (in the process missing points that don't quite lie on the smooth curve), or you can simply eyeball the data and come up with a reasonable fit (for display - not for analysis).

I spent just a couple of minutes on this, but came up with the following:

This is basically an overlay of an Excel plot that I created (making the axes invisible) - using a simple 4 parameter model:

For the blue and green curves, I found parameters

    blue  green
A    0.8    0.8
B    1.0    1.0
C    1.0    0.5
D    .05    .03


Obviously since you have the raw data and matplotlib, you must know how to do a better fit, but this works well.

In general, I like to show only as much information as is needed on a plot. If the point is "this is a rapidly decaying curve and green is above blue", then I would definitely leave off the grid, and maybe even most of the numbers (run the X axis from 0 to 100, with just two labels, and the Y axis from 0 to 1).

I think that your data probably doesn't go negative - so I would definitely want to fix that X axis.

If you want to further make the point "we measured this data", then leaving the points on the graph as well as the smooth fit is an OK thing to do. I would consider adding error bars to show that the fit is good - and that the points are bad.

Again - you want to make it so that the information is "only what you need". My personal preference would be like this:

So fewer ticks on the axes, but do add a legend (I call them "blue" and "green", but you should use a more meaningful name) and do label the axes - numbers alone are not enough.

• To me not having points on the plot takes away the experimental nature and make it look like the results are far stronger than they are. – Lyndon White Sep 22 '14 at 23:17
• @Oxinabox - yet to me, a "doodle" with very few ticks on the graph (my bottom plot) suggests the opposite - namely that the results are weaker. But that's why I said - "It depends on the message you want to convey." Include experimental points (and error bars) if they add to the storyline - don't include them if they don't. – Floris Sep 22 '14 at 23:21
• hmm yes, perhaps... tex.stackexchange.com/questions/74878/… – Lyndon White Sep 22 '14 at 23:24
• @Oxinabox - yes: xkcd is a great source of "approximate" plots, and the density of labels tells a story. My favorite example: Ballmer peak. High density of labels on X ("very narrow peak"), no labels at all on Y ("how do you measure programming skill") – Floris Sep 22 '14 at 23:28
• MathJax is not supported in Academia.SE. You can write an equation in plain text, or use a web service like this to generate an image of your equation (as I did here) – ff524 Sep 22 '14 at 23:40

Grids are an obsolete fossil that should no longer be used. Back in the days, they helped to make the plots, and also made easier to manually retrieve the data from the graph. Nowadays, it is no longer necessary, as tables with the data are available elsewhere.

And if and when they are necessary, they should be as little intrusive as possible. Your grey-blue background is just too heavy.

Once that is out of the way, you can try a log scale for the x axis, as many points are accumulated near 0:

I think here is pretty clear that blue is always greater than green. Whether adding a line or not is good, is a matter of taste:

In my opinion, and as a general rule, I would say that the lines are acceptable as long as the "wiggling" is due to the actual shape of the function, and not due to noise. That is, when adding more points (taking more measurements) will not change significantly the shape of said curve (or we don't expect it to).

• "tables with the data are available elsewhere." If that only were true... I work a lot with grids (I even produce reference plots on fine grid like a mm-sheet). IMHO the problem with grids is not the grid itself, but that many grids are distracting from the graph instead of helping to read it. E.g. in your example, the dotted grid lines are at the same time far to dark and obtrusive and due to being dotted don't to their job of helping to find intersections. Consider very light lines instead that are not distracting the impression of the graph, but if you concentrate on them help measuring. – cbeleites supports Monica Sep 23 '14 at 14:54
• @cbeleites if you need accurate values, you should not be manually reading from plots, but using digitalised tables, as there is too much chance of errors. A plot should help to show the order of magnitude, the general trend and the noise levels. – Davidmh Sep 24 '14 at 12:22
• I do not think grids lines are obsolete, as they even approximate visual estimation is much more difficult without them. Going that way, one soon may say numbers on the axis are redundant. – h22 Sep 25 '14 at 11:26

An alternate approach to connecting the dots: insert a line between the datasets to illustrate that one set of points is above the line and the other below. If it is not inappropriate to the data, use a log scale for X to gain some space between the packed points at the left to improve visibility. Use of higher contrast colors and marker shapes was previously suggested.

Normally it is better to use some kind of curve fitting (splines, etc), as we are not assuming that the measurements are absolutely accurate and the connecting lines should go from point to point.

However measurement points must also be present and very clearly visible, as they are our results and the line is our hypothesis, interpretation. Ideally showing error bars (confidence intervals) would be a good idea.

• I rejected showing error bars as too likely to confuse the audience. Also the connection between the lines really isn't my hypothisis. it is A hypothisis, but it has almost nothing to do with the story I am telling. My story is about points being below other pounts – Lyndon White Sep 25 '14 at 8:37
• What kind is your audience to be confused by error bars? If they are scientists, they have seen such bars many times before. – h22 Sep 25 '14 at 11:17
• As it says in the question post, they are engineers (well final year engineering students). Basically none of them have seen error bars since highschool. – Lyndon White Sep 25 '14 at 11:22
• Strange, biologists are taught statistics and engineers not. Well, then may be unusual audience for me. – h22 Sep 25 '14 at 11:23
• Why would your average engineer need experimental statistics? Very very few engineers go on to do research, compared to biologists – Lyndon White Sep 25 '14 at 11:30