How to add another plot to box plot?

9 vues (au cours des 30 derniers jours)
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 15 Jan 2020
Modifié(e) : Adam Danz le 17 Jan 2020
I need to make plot like this:
1.JPG
I know how to plot each individually but dont know how to plot them next to each other like the image.
  10 commentaires
Adam Danz
Adam Danz le 15 Jan 2020
" so the points mentioned above (being vector, using 'ko',...) does not change the issue I have"
It's hard to address the issue you're having when you haven't explained what the issues are.
This line from your code plot(2,y) will definitely not produce the plot you want since it will produce lines, not black circular markers. So the 'ko' does address that problem. If y were a matrix, it would also produce undesired effects which is why y must be a vector - but again, we don't know what the issues are.
'Using above code the boxplot was produced but the nex plot (the plot after hold on) was not shown"
Ahhhh... there we go. The points created by plot() are plotted but you just can't see them.
Here's your fix:
xlim([0,3])
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 15 Jan 2020
xlim worked. Thank you. Can you move your comment to answers so that I can accept?

Connectez-vous pour commenter.

Réponse acceptée

Adam Danz
Adam Danz le 16 Jan 2020
Modifié(e) : Adam Danz le 17 Jan 2020
Summary of comments under the question
The problem was that the x axis limit was [0,1] while the plotted data were at x=2.
The solution:
xlim([0,3])

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by