How can I select lines in a subplot and delete them?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello World,
I'm currently struggeling with my figures.
I have a figure saved as FIG-file. After I opened it I want to select a specific subplot in it and delete a specific line object in the subplot.
What I know so far is that I can find all subplots/axes (?):
>> h1 = findobj(gcf,'Type','axes')
and that I can find all line objects in the subplot/axis:
>> h2 = findobj(gca,'Type','line')
But how do I link these two informations? Which one of the output of the first command (h1) is the subplot I want to choose? And which one of the output of the second command (h2) ist the line I want to choose?
As the size of h1 and h2 differs from the number of subplots / number of line objects I can see I'm confused with the output.
Any idea? Sebastian
0 comentarios
Respuestas (3)
Honglei Chen
el 14 de Mzo. de 2012
If you don't need to automate the process, it's actually easier to do from the figure window. Just click the arrow on the toolbar, and then choose any line from any subplot.
Jan
el 14 de Mzo. de 2012
We cannot know which of the handles in h1 is the wanted subplot. It is your turn to define this detail.
So start from scratch: How do you define, which line you want to delete?
Stephen
el 14 de Mzo. de 2012
when you use gca for h2 it will only look in the last axes that was called. you can try recalling the subplot you want, then doing the gca. i.e. subplot(2,3,2) for the 2nd axes in the figure. Then your line should be in h2. Depending on how you plotted the data, it will be in that order in h2 for you to call it and delete it. good luck
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!