As part of a psychology experiment, I surveyed 15 users. I separated them in two groups, those who have become smoke free, and those who are still smoking. These groups have different sizes (9 and 6).

I want to show graphically that the smoke free group reported higher values of the survey index. This is my current best attempt, with Google Sheets:

enter image description here

However, I think that a correct comparison should have the same number of data points. I guess I need some form of interpolation, but not sure how to proceed.

An alternative approach is using a bubble chart:
enter image description here

My questions:
1. Would you recommend a different chart?
2. Should I have the same number of data points? If yes, how to achieve that?


By downloading the Free Wolfram Engine for Developers you may use Wolfram Language. If you are using Python then use the Wolfram Client Library for Python to access the engine in Python.

You may use BoxWhiskerChart with Labeled to show the distribution of responses and label how may responses in each set.

I'll generate some responses for each of the two groups.

survey = MapThread[RandomVariate, {UniformDistribution /@ {{3, 5}, {2.5, 4}}, {6, 9}}]
{{3.91144, 4.95565, 4.88643, 4.92443, 3.6047, 3.93342}, 
 {2.59246, 3.07847, 3.14476, 3.66812, 2.57289, 3.4424, 2.91698, 2.63533, 3.81488}} 

Then plot with a number of observations label located at the "UpperFence" of each set.

 Labeled[#, "Obs: " <> ToString@Length@#, "UpperFence"] & /@ survey,
 ChartLabels -> {"Smoke free", "Smoking"},
 ChartStyle -> {Orange, Purple},
 GridLines -> {None, Automatic}]

Mathematica graphics

Hope this helps.


How's a net? Where you colourize binary (e.g. orange = smoker, blue = none-smoker) and the distance to the midpoint of the circle shows how happy they are.

Find also a screenshot how to arrange the data (i.e. Excel)

Chart Idea Aranged_data

  • $\begingroup$ Thank you! This would not solve my problem because it does not provide a direct comparison of the two groups. The difference between the two samples is small, about 10%. $\endgroup$ Oct 18 '19 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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