How can I interpolate medians in a box plot?

6 ビュー (過去 30 日間)
Alessandro
Alessandro 2019 年 3 月 26 日
回答済み: Rik 2019 年 4 月 29 日
Good morning. I have a number of box plots (generated using boxplot) and I would like to draw a line on the plot that connects the median values. Given the plot shown in the image, I would like to connect the red horizontal lines of the box plots in order to show the diminishing trend of the median values.
interpolazione_box_plot.png
Is that possible? How can I do it?

回答 (1 件)

Rik
Rik 2019 年 4 月 29 日
You can probably extract the median value from the object boxplot creates, but you can also use the median function to find the median values of your groups.
Then you can overlay your plots by first using hold on, and then using plot to insert your plotted line.

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by