14 ms·
I've stopped using box plots (2021)
- jcims 2y agoWhat about violin plots. https://en.m.wikipedia.org/wiki/Violin_plot https://en.m.wikipedia.org/wiki/Violin_plot
- 317070 2y agoI was thinking the same thing while reading, but the author does mention them at the end (together with the bee swarm plot or sina plot, which I think is the better version of a violin plot) https://www.rhoworld.com/i-swarm-you-swarm-we-all-swarm-for-beeswarm-plots-0/ https://www.rhoworld.com/i-swarm-you-swarm-we-all-swarm-for-...
- Scea91 2y agoI use violin plots but a complication is that the shape depends upon the bandwidth hyperparameter of the kernel density estimator that is used inside. The plot can differ a lot for different bandwidth values. Selection of the 'proper' bandwidth is a classic bias-variance tradeoff problem.
- mjfisher 2y agoThe author mentions those at the bottom of the article, but two problems highlighted still remain: * There's another intermediary concept (kernel density estimation) between the audience and the data * They're still likely to misrepresent tight groupings and discontinuities, which will be smoothed out
- adammarples 2y agoHistograms and box plots are just clunky kernels density estimates too
- bdjsiqoocwk 2y agoThe author just has a bad intuition. On the first picture he says "this looks like a small quantity". No, you can't say that. All you can say is that half the data points are in the shades part. You don't know where the rest are.
- deleted 2y ago[deleted]
- Jaxan 2y agoI don’t think intuition is the right word. If you have never seen a box plot before, your intuition will not help parse it. (Unlike violin plots.)
- wyldfire 2y agoIn my experience of sharing violin plots with people who are unfamiliar with them, it's not intuitive that the curve represents the distribution. Even with the scatter plot over/underlaid. But that's okay, I don't mind explaining it and then the graph is easier to interpret imo.
- wesleywt 2y agoYou need to develop the intuition in the first place to read box-plots. The author argues that there are other plots where you don't require intuition.
- ncruces 2y ago> You don't know where the rest are. Of course you do: they're in the whiskers; half in each whisker. That's the entire point of the picture, BTW.
- lkdfjlkdfjlg 2y agoYou're right. I guess that's not the author's mistake then. His mistake is assuming "the whisker is small, therefore it has a small number of datapoints".
- rhdunn 2y agoWhen profiling slow queries/code I often collect the elapsed time of a test where I take 5-10 runs and calculate the mean/average, standard deiviation, min, and max. As well as using line charts on the average, I've used a box plot (with the edges of the box being the mean +/- 1 standard deviation) to get an idea of whether a given change is significant or not. I.e. if the boxes are close together I will ignore a change I've made, only committing changes that provide a significant jump in performance. The box plot is a useful way of visualizing that. They can help with seeing highly variable performance (long box) from consistent performance (narrow box). I can see this in the data (mean, standard deviation) but having it represented visually can help -- especially looking at the data over several iterations, or when looking for patterns from changing a variable (like the number of items in the data being processed). I've also used linear regression calculations when data has looked linear or quadratic to check/confirm that assumption. -- You can overlay that on top of the data by computing the values for each value of n along side the actual data average and then including the average and calculated values in a line chart.
- SillyUsername 2y agoSo the diagram should not be used because of an education problem with some audiences? Isn't that a bit like banning cars because some people can't drive? Some diagrams are simply not for mass consumption and this is one, particularly because it is designed to illustrate an interpretation of ranges instead of the direct/linear representation of the raw data. Of course I'd illustrate this fact as a Venn diagram comparing "box diagram" Vs "people" (intersection those who understand it) but I'm afraid the universal set may be mistaken as "those people who don't have eyes" rather than literally everything else. Perhaps we should stop using that too, since it's non obvious what the universal set is. All diagrams have some ambiguity and can be misinterpreted, sometimes it's deliberate (e.g. bar chart vertical axis not starting at 0 or scale not being linear) and that's why there's the saying "There's lies damn, lies, and statistics." That doesn't mean some diagrams are not useful, just that it's not suitable for some audiences who may misinterpret the data.
- SillyUsername 2y ago[flagged]
- ohmyiv 2y agoPlease don't comment about the voting on comments. It never does any good, and it makes boring reading. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- SillyUsername 2y agoPoint taken (not literally), I'm agreeing :)
- richrichie 2y ago[flagged]
- SillyUsername 2y agoHa, love it. Except on probability I'm probably much older than you. I'm not sensitive, I'm irritated at the effort to put together an argument but zero effort (pun intended) to argue the point.
- ekianjo 2y agojust use boxplots with an overlay of the actual data and any confusion goes away
- flumpcakes 2y agoThis is the way to go in my opinion. I think it’s the easiest, most straight forward, and not confusing to the reviewer. You shouldn’t be using box plots to describe the shape of data to begin with, but having a ghost/after image/super imposition can probably only help in cases where you need to communicate that the shape is different, even if the statistical nature is the same.
- cjk2 2y agoNo you shouldn’t stop using box plots. You should use them for when they are appropriate - showing location and spread. And not shape! There’s absolutely no information on modality or distribution presented past quartiles and limits. They are mostly useful for comparing batches not analysing an individual batch. The author doesn’t know what they are talking about and is telling people as if they do. If he read any of Tukey’s material he might know. But no name dropping is enough clearly…
- ohmyiv 2y ago> No you shouldn’t stop using box plots. You should use them for when they are appropriate Yes, the author is aware of that. They even stated so: > Despite making more visual sense than box plots, I still wouldn’t recommend these design concepts or box plots in most situations because… Seems a few people missed the "in most situations" part. He's saying he stopped using them for whatever reasons because it isn't working for his audience. So as the title suggests, maybe we should all take a look at our use of box plots and see if there are better alternatives. Also remember who he's talking about when it comes to reading box plots. He's not talking about people who understand box plots. He's talking about others that don't know or understand box plots, which seems to be thousands of people he's had to explain it to, according to him.
- cjk2 2y agoThe author doesn't use the correct terminology and does not understand box plots themselves so they are in no position to explain them to anyone. They explain in terms of absolutes with no rational or scientific explanation and entirely miss the point of the methodology and tools. That is a not a good position to start or a good person to take advice from. Not only that, the cases presented are likely better dealt with via inference tests. But the author's knowledge doesn't extend that far. And even going as far left, the posed question isn't even defined in the article. So how was a suitable methodology chosen? Well it wasn't - lets just throw this pretty picture up and whine about it. The author is way out of their depth and should retract the article and take a formal, accredited statistics course.
- psyklic 2y agoBox plots make distributions easier to reason about by oversimplifying them. In a similar way, the mean can be very misleading (but we likely won't forbid its use!). IMO a good takeaway might be to always use a plot that fairly represents the underlying distribution.
- sigmoid10 2y ago>box plots always make distributions look bell shaped I feel like this is where the confusion stems from for the author and everyone else here. Box plots don't make anything bell shaped (they don't change the distribution), they assume that your data follows a bell/gaussian shape. This is correct in cases where the central limit theorem can be applied (which is almost everywhere) - but when that is not the case, the assumption is wrong and you shouldn't use a box plot anyways, because the values it shows have no real use. There are very real use cases for box plots, but people need to understand the basics of statistics before they can use them.
- blueflow 2y agoThis should be the topmost comment. Box plots are made for visualizing generalized normal distributions and nothing else. Edited to preempt nitpick.
- cjk2 2y agoThis is also wrong. Gaussian curves are symmetric. Box plots do not have to be. In fact representing skew in a batch is one of the fundamental purposes of them.
- crazygringo 2y agoBut representing skew is precisely to show how "off" from a Guassian it is. Because real data is never perfectly Guassian, or perfectly anything. But the idea of a box plot is that it's for data which is in theory Gaussian or a similar unimodal kind of bell-shaped curve. Then you can look at the box plot and see if it actually is -- are the two boxes roughly equal-sized? Are the lines a bit longer than the boxes but not insanely so?
- blueflow 2y agoYou model skew in Gaussian distributions by adding an exponential parameter.
- 2y ago
- mkl 2y agoThe only advantage box plots had is that they can be drawn by hand. Now that computers are ubiquitous this is no longer valuable. Violin plots and bee swarm plots are better. Jittered strip plots can be okay if you're careful to avoid saturation (or more points added in the saturated region will disappear as they can't make it any darker).
- frodo8sam 2y agoI'll take a plain histogram/kde plot every day of the week over those damn violin plots. I think box plots are quite usefull as they are easy to read but only if you trust the author has actually looked at the histogram. And you can typically not trust the author to have done that.
- mkl 2y agoViolin plots essentially are KDE plots, but you can put multiple of them on the same axes to compare groups.
- medstrom 2y agoPerhaps you'd find the half-violin plot more readable? Seems there's a whole world of all-in-one "raincloud plots" that integrates them, like the lower infographic here: https://raw.githubusercontent.com/Z3tt/TidyTuesday/main/plots/2020_31/2020_31_PalmerPenguins.png https://raw.githubusercontent.com/Z3tt/TidyTuesday/main/plot... You can even make 'em show histograms: https://miro.medium.com/v2/1*J3Q4JKXa9WwJHtNaXRu-kQ.jpeg https://miro.medium.com/v2/1*J3Q4JKXa9WwJHtNaXRu-kQ.jpeg
- catlifeonmars 2y agoFor the latter, it looks like the histogram is probably sufficient. The violin plot just adds extra visual noise.
- klysm 2y agoA violin plot is literally just a KDE sideways.
- y42 2y agoIn short and unsurprisingly: Not every analysis and data set works with every visualisation.
- montebicyclelo 2y agoThe author has experience of teaching box plots in various organisations. The author has found that compared to other types of plots, people struggle to learn how to intepret box plots. The author proposes some alternatives that they believe to be easier for people to interpret: - Strip plots (for few data points) - Jittered strip plots (for more data points) - Distribution heatmap (for even more data points) ---- This aligns with my experience of trying to convey information to non-technical or moderately technical people; box plots are a struggle for them. To me it does seem like the proposed alternatives would be more accessible. Sure, we could try to better educate people about box plots, (as the author has done professionally); or we could consider using something that requires less effort for people to comprehend.
- scrollaway 2y agoYeah I'm shocked at the awful quality of comments here. This is a clear and straightforward article laying out the issues with box plots and appropriate alternatives, from a professional who works in the field and spends his life explaining these. And still half the comments are like "But I know better!"... yeah, I'd wager most here don't.
- SillyUsername 2y agoI'm qualified in maths related computing and statistics to exam invigilator level, if that helps offset your bias.
- scrollaway 2y agoNo bias -- By commenting a lot, you're overrepresenting the average HN audience. Which kind of nullifies your point, doesn't it? You argue in other comments that it's just an education problem, but box plots are used with people who don't have this exact education you mention, and the article explains that a drawback of box plots is exactly that it isn't intuitive and takes several minutes of explanations. In other words, the article says "I've stopped using this because they require education", and your retort is "Don't stop using these, you just need to educate people".
- becide5633 2y ago[dead]
- becide5633 2y ago[dead]
- deleted 2y ago[deleted]
- wodenokoto 2y agoI’m a big fan of the jittered strip plot and I often ad special logic to color dots at the edges of a largish gap. This is super useful if you are plotting the distribution of daily messages and just plotting dots will hide that there are days without messages
- These335 2y agoSure there are alternatives and I agree with the author's criticisms overall. But boxplots are a staple in statistics, and if your audience can reasonably be assumed to have some level of statistical training then boxplots are perfectly reasonable in my opinion.
- cqqxo4zV46cp 2y agoWould you care to address the specific argument that the author makes about not using box plots with audiences? I swear, statisticians are among the most inertia-prone groups of people that I’ve ever worked with. You need a certain degree of “do it this way because it’s done this way” to deal with the amount of BS going on in this field.
- sloowm 2y agoAre you sure that well trained audiences are able to accurately asses box plots. For instance, most drivers think they are better than average drivers. It being a staple in statistics is also not a good argument. The information conveyed through box plots is used in lots of fields with different education backgrounds. If a visualization, which in itself is a human simplification of data, is hard to understand, it will be misunderstood by some. This means these people will not be able to advance their field of research as well as with better visualization methodologies.
- CuriouslyC 2y agoBox plots are a relic of a time when we couldn't print really nice charts. You can just display the distribution in line like a scrolling oscilloscope/topographic display, or you can do a density plot over time (look at gaussian processes) and overlay shaded regions for important time periods.
- zaptheimpaler 2y agoI always find new types of plots very interesting. Is there a nice resource showing all the common types of plots, when to use them, alternatives, code etc?
- amelius 2y agohttps://matplotlib.org/stable/plot_types/index https://matplotlib.org/stable/plot_types/index https://d3-graph-gallery.com/ https://d3-graph-gallery.com/
- cb321 2y agoThe @amelius sibling has nice links to "graphics" choices, but I feel like the overall topic of the original article and this comment thread is more about the interaction of that with "statistical choices" as per my other comment (https://news.ycombinator.com/item?id=40766618 https://news.ycombinator.com/item?id=40766618) pointing to plots you might like to peruse. For example, though the final example in the reference there is graphically "only" shading the "outer band" darker than the inner alpha-blended region, this seems important statistically/visualization-wise since the unknown true parent distribution/ensemble samples are, well, sampled from need only be any monotonic curve within the whole region.. (not even differentiable if mixed discrete-continuous values may happen).
- singingfish 2y agoAnd no mention of notched box plots which make a lot of the troublesome aspects go away?
- kkfx 2y agoHonestly? I do not care much about charts in general, while I do care much about the availability of the data used to produce a chart... In way too much cases I see plots and no data, sometimes data are there but not easy to use, and another thing I do care is the ability to tweak a graph. The above are between the reasons I prefer remote meeting where data are to be shown instead of in person: anyone attending should have a computer ready to use and IF data are shared and ready usable I can live tweaks a plot ad reason on it while I listen end eventually pose relevant questions shown at my own turn something. Surely not all presentations are meant to be interactive session, but being able to interact even in async form reading a journal article, playing with the data and eventually drop a mail to the author is a nice thing, typically uselessly hard today where in tech term it can be extremely simple. That's another reason I have presentation software/office automation one instead of plain org-mode, Jupyter, R Studio etc because change things it's hard while it should be easy. Org-mode is excellent to present but not really interactive, I have to regenerate plots to see changes or push data to external software, Jupyter is not really meant to present, R Studio offer nice LaTeX integration and tabular view but do not offer nice means to present, though they are still FAR better then presentation software and even if have some safety aspects to be taken into account I prefer countless of time receiving an active document (org-mode, jupyter notebook etc) instead of a pdf or even worse some office formats.
- karmakaze 2y ago> There are other distribution chart types that can be useful in specific situations, such as frequency polygons, violin plots, cumulative distribution plots, and bee swarm plots, but the three types that I described above are the easiest ones to grasp, and are able to communicate most of the insights that are needed for day-to-day decision-making in most organizations. (I’m not mentioning histograms here because they’re generally only useful for visualizing a single set of values, whereas box plots and their alternatives are for visualizing multiple sets of values, which is a different use case.) There's generalizations and 'specific situations' which the author considers worthy of some plots, and other specific situations that the author doesn't consider worthy of other plots. At best, don't use box plots if your distributions do not have a single mode and may likely be misinterpreted is my takeaway. Here's a rant against violin plots by my fave physicist ranter[0] (not Sabine), so maybe never use them. [0] https://youtu.be/_0QMKFzW9fw?si=4VM4DT9Q1zEnV93A https://youtu.be/_0QMKFzW9fw?si=4VM4DT9Q1zEnV93A
- deleted 2y ago[deleted]
- cb321 2y agoPeople have conflicting goals. On the one hand they long to compress many numbers into one or a few summary statistics. On the other hand, the moment such lusted after summaries mislead in some way they regret the data compression. What's really going on is that people want a simplicity (often in the form of definite conclusions) which may just not exist. This is really a common malaise of the human condition. Similarly, the distribution represented by a box plot itself is often the distribution of "just one sample". When viewed as such, a distro has its own uncertainty[1] and that uncertainty is not represented in a violin plot, for example. As with every "right tool for the job" debate, people will vary based on experience with the tools, including how to simplify/explain them to others. [1] https://github.com/c-blake/bu/blob/main/doc/edplot.md https://github.com/c-blake/bu/blob/main/doc/edplot.md
- riedel 2y agoActually you may nicely integrate box, violin, bee/scatter plots [0]. For simple visual ANOVA testing box plots are great. On the other hand violin plots are great to quickly check distribution assumptions for testing and together with scatter plots give you a good impression of the sample. [0] https://davidbaranger.com/2018/03/05/showing-your-data-scatter-box-violin-plots/ https://davidbaranger.com/2018/03/05/showing-your-data-scatt...
- iainmerrick 2y agoLots of people defending box plots here -- a lot more than I expected! What I don't see is anyone saying "box plots are useful because they're the best kind of chart for [specific use case]". I can't off-hand think of any situation where I'd rather see a box plot than a strip plot or violin plot. When and why would you want to summarise the data so coarsely and visualize it so un-intuitively?
- lkdfjlkdfjlg 2y ago> What I don't see is anyone saying "box plots are useful because they're the best kind of chart for [specific use case]". Box plots are useful because they're the best kind of chart for when I have multiple populations and I want to quickly glance whether it's reasonable to assume that the populations have the same median, or not (you do that comparing not just the medians of the populations but also the shaded areas)
- johnbcoughlin 2y agoI can't see why a jitter plot with dark lines marking the quartile wouldn't be strictly better for this.
- aniviacat 2y agoThat's just a box plot with extra steps. Sure, the jitter plot provides more data, but if you only make use of the quartiles anyway, that extra data is but an unnecessary distraction.
- weebull 2y agoIf you're only comparing medians, then just plot the medians. Why a box plot with the quartiles?
- lkdfjlkdfjlg 2y agoOk, so the difference between medians is 42.7. Is that a lot or a little?
- michaelhoffman 2y agoWherever possible, I use sina plots, which provide many of the advantages of violin plots while actually showing the individual data points. https://en.wikipedia.org/wiki/Sina_plot https://en.wikipedia.org/wiki/Sina_plot https://cran.r-project.org/web/packages/sinaplot/vignettes/SinaPlot.html https://cran.r-project.org/web/packages/sinaplot/vignettes/S... Adding on a representation of mean in a different style (like a black bar) can be helpful. So can a boxplot-style indication of variance, in some cases.
- benrapscallion 2y agoDo it the way Nature journals now require it to be done: show the underlying data points overlaid on the box plot. Best of both worlds.
- inSenCite 2y agobeen in love with violin plots
- chefandy 2y agoJust like anything else in design, the first question should be "how can I convey this most clearly to the audience I'm addressing" not "hmm, I wonder if there's are any problems the technique I chose because it's what everyone seems to use for this." Use the right tool for the job. There's even a good chance that juxtaposing these elements differently or adding another element could clear this up entirely. This is why it's good to have a really competent visual designer around. Their sole purpose is visual communication, and that very much includes dealing with the subconscious connotations and unintended messages hidden within data visualizations. Yes, you've probably encountered designers that would not be good at that, you imagine. You've also probably encountered developers that would not be good at the sort of data munging that scientists, et al do; that doesn't mean developers, generally, aren't best equipped to handle the related coding problems.
- svara 2y agoThe alternatives he proposes have their problems too. Just plotting points will lead to saturation in high density areas that depends on point size and opacity. Making bin color proportional to point density will require normalization to make the plot readable in many cases. While I like these plots too in certain situations, I would argue they're actually less elegant than the boxplots for those reasons. And come on, boxplots aren't that hard to explain to someone who already is used to working with percentiles.
- klysm 2y agoI think there is an aversion to just showing the damn distribution as a histogram or KDE. I hear arguments from product owners that it’s “too complex” etc.
- jncfhnb 2y agoThe author showed jittered strip plots where you plot each point correctly on the y axis and randomly offset the x axis. These are ok but it’s hard to differentiate the density of points when they’re randomly offset. Try a swarm plot (seaborn) / bee swarm plot (R). It’s the same concept but the points are strategically placed across the x axis to show the width of the distribution at each point. It generally looks much cleaner.
- emilk 2y agoImportantly, box plots are also ugly. Beauty matters.
- Falkon1313 2y agoI was not entirely convinced by the article, being used to box plots myself for several decades. I've used them in school, college, and at work. But after having read these comments, it really drives home his point that you can get a room full of lots of very smart people who all know what they're talking about, and they'll all disagree about the understanding and interpretation of box plots. It's a little surprising, but the evidence in these threads pretty much cinches the argument for me.
- flusteredBias 2y agoECDF plots are what I use.
- __mharrison__ 2y agoI've resorted to just teaching four plot types when I teach visualization. - Bar - Scatter - Line - Histogram You can tell 90% of your stories with these plots. (If you pay attention to professional viz groups, Economist, NY Times, etc, they use these.) Don't waste your time with other plots unless you have mastered these. When you master these, you will realize you don't need other charts.
- moi2388 2y agoI’m probably wrong, but this entire article felt as an advertisement for violin plots without it being mentioned once
- pvaldes 2y agoThat problem has been solved long time ago. When a box plot is not enough, just use violin plots On gnu-R: install.packages('ggplot2') ?ggplot2::geom_violin
- Kalanos 2y agoPlotly has an option on box plots that shows the individual points as well, which I like better than violins
- greentxt 2y agoJust use a heat map instead. /s
- nickdesb 2y agoAs the author of the original Nightingale article that kicked off this (wild) thread, maybe I can clarify a few things: My fundamental concern with box plots is that no one has ever shown me a single scenario in which a given insight was clearer in a box plot than it would be in a simpler chart type (i.e., strip plot, distribution heatmap, or stacked histograms). If someone can show me even a hand-crafted, cherry-picked scenario with the same data shown as a (well-designed) box plot AND a strip plot, distribution heatmap and stacked histograms, and in which a potentially useful insight is clearer in the box plot than in the other chart types, I’ll happily change my opinion. I’m still waiting for someone to show me such a scenario, though. In the meantime, I’m not sure why one would use box plots when simpler chart types are available that say the same thing about the data or, in many cases, say more about the data (show gaps, multi-modal distributions, etc.). Even if the audience is very used to reading box plots, they’ll still find strip plots, distribution heatmaps and stacked histograms to be simpler to read (and will actually see gaps, clusters, etc.) How do I know that other distribution chart types are simpler to read than box plots? Because I’ve taught these chart types to literally thousands of people of all skill levels all over the world. Quartiles are just inherently less intuitive than bins or, in the case of strip plots, no delimiters to understand at all. Like I said, if someone can show me a scenario like the one that I described above, though, I’ll happily change my mind… Before people jump all over me, I should clarify what I mean by a “potentially useful insight.” For example, “showing the interquartile range” is not an “insight” in this context, it’s an “observation” because it doesn’t point to any kind of action or conclusion, in and of itself. A potentially useful insight would be something like, “The employee salaries in Company A are generally higher than those in Company B.” or “Most people make close to $80K in Company A, but the salaries are much more spread out in Company B.” Basically, an “insight” in this context is a piece of information that would point directly to some kind of action or conclusion.