How to created a dashed box around a specific set of data on a plot

18 visualizaciones (últimos 30 días)
Tristan Flannery
Tristan Flannery el 25 de Oct. de 2020
Editada: Adam Danz el 27 de Oct. de 2020
I want to place a dashed box around various set of points on each of the 6 subplots. Also, If someone could explain why the label for the sixth plot won't appear that would also be very helpful!

Respuestas (1)

Adam Danz
Adam Danz el 26 de Oct. de 2020
Editada: Adam Danz el 27 de Oct. de 2020
Use rectangle('Position',pos) to draw a rectangled within a subplot.
The labels in subplot #6 are not appearing because you're assigning the labels (to the previous plot) prior to creating the 6th subplot. Move subplot(3,2,6) to the top of that section -- you should do that for all subplot sections. Define the subplot before plotting on it and adding labels.
% This is how all of your subplot sections
% should appear
x6 = ...
y6 = ...
subplot(3,2,n)
plot(x6,y6)
xlabel(...)
ylabel(...)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by