How to label datapoints in a boxplot?

37 views (last 30 days)
Nuria Andreu
Nuria Andreu on 30 Jun 2021
Commented: Sabrina Bitz on 13 May 2022
Hello! I have a boxplot with 3 subplots in it. I want to display each median, outlier, whisker, etc in my figure. I do not want to use a text format because I want to use the same code for different CSV files. The CSV files I will use later on have different medians, outliers, etc.
Hope anyone can help me
Thank yo!

Answers (1)

Kishan Dhakan
Kishan Dhakan on 30 Jun 2021
To modify graphics properties of a box plot component, use findobj with the Tag property to find the component's handle. Tag values for box plot components depend on parameter settings, and are listed in the following table.
Parameter SettingsTag Values
All settings
  • 'Box'
  • 'Outliers'
When 'PlotStyle' is 'traditional'
  • 'Median'
  • 'Upper Whisker'
  • 'Lower Whisker'
  • 'Upper Adjacent Value'
  • 'Lower Adjacent Value'
When 'PlotStyle' is 'compact'
  • 'Whisker'
  • 'MedianOuter'
  • 'MedianInner'
When 'Notch' is 'marker'
  • 'NotchLo'
  • 'NotchHi'
  2 Comments
Nuria Andreu
Nuria Andreu on 30 Jun 2021
Hello, but how can I dispay the values into the boxplot? I want it to look like this image with median values, outliers, etc:
but this is the result I am getting right now
thank you!
Sabrina Bitz
Sabrina Bitz on 13 May 2022
Did you get it? I have the same question.

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!