I want to visualize some data with a boxplot -- and I am wondering, if the boxplot is even the correct way for visualizing the data.

I want to compare three datasets (40 entries each) using boxplots. Basically the first two datasets are always the same numbers, the third set has only a few outliers:

(geregelt: 62, 62, 62, ... 62)

(optimiert (fair): 65, 65, 65, ... 65)

(optimiert (unfair): 100, 100, 100, ... 30, 0, 0, 0, 0,)

With these data, the boxplots dont even look like boxes, just three strokes; see image:

enter image description here


I want to compare, how much energy electric vehicles get charged from the grid, depending on the loading strategie: controlled (geregelt), optimized (optimiert (unfair)) and optimized with constraint for fairness (optimiert (fair)).

So what I am trying to point out with these data is: with optimization the electric vehicles get charged the most, even thoug some are left without any charging. With optimization including fairness constraint, everybody gets the same amount charged. And with the controlling still everybody gets the same amount charged, but slightly less compared to the fair optimization.

actual question:

Is the boxplot the correct way of visualizing such data? Or is there a better way? Is it even useful to use boxplots when they don't even look like boxes?

  • 5
    $\begingroup$ A boxplot that does not look like a boxplot imposes non-needed cognitive burden on the reader, even if it is not wrong. You might consider barplots. E.g., faceted barplots. $\endgroup$
    – Bernhard
    Commented Jul 30, 2022 at 8:47
  • $\begingroup$ What are the 40 columns that are all the same number?! Doesn't sounds like real data to me!? $\endgroup$ Commented Jul 30, 2022 at 17:29

2 Answers 2


Visualisations need to be chosen based on the properties of the data and the message you are trying to convey. Clearly, boxplots do not communicate the distribution of this data well. Given that you have just 40 entries in each group and most values are identical, you might consider using a table, a dotplot, or translucent histograms with appropriately chosen bin width.


The boxplot doesn't visualize your data effectively. (For a discussion of the advantages and disadvantages of boxplots see How should we do boxplots with small samples? .)

Other types of graphs (except a barplot as suggested by @ Bernhard) would have trouble with you data because there is almost no variability within loading strategy; this leads to overplotting.

But since there are so few distinct values I would consider making a table instead of a graph. For example, a table with columns Loading Strategy, Target (%) and #Vehicles. Or %Vehicles since there are 40 vehicles for each strategy, so we can meaningfully compare the counts divided by 40. Rows within a table can be effectively grouped together with color highlights as well.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.