How can I delete a plot among many plot in one figure?

Hi everyone,
I plot twice in one figure by using the hold on, but I find my 2nd plot is wrong. So I have to delete the 2nd plot, but I don't want delete the 1st one nor do I want to plot them again. Is there any methods?
Thanks a lot~~~

 Akzeptierte Antwort

Thomas
Thomas am 21 Sep. 2012
This thread might help (If you have plotted the two separately ) http://www.mathworks.com/matlabcentral/answers/1444-clear-one-plot-in-multiple-hold-figure
h1=plot(1:4)
hold on
h2=plot(2:8)
delete(h2)
Or use the findobj to find the second plot and delete it.
doc finobj

2 Kommentare

Is there a way to bring back a signal after deleting it? or if we can use plot/unplot all the signals in the plot by using something like a check mark?
Rik
Rik am 22 Jun. 2020
(just to avoid a double thread with the same question, I replied in the other thread this was posted)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Wayne King
Wayne King am 21 Sep. 2012
Bearbeitet: Wayne King am 21 Sep. 2012
Click "edit plot" -- the arrow next to the printer icon.
Then, click on the line you want to delete and then delete it.
Another way, is to click on the line you want to delete and then with that line selected.
>> h = gco;
>> delete(h)

3 Kommentare

tqy
tqy am 22 Sep. 2012
Thanks a lot.
As in on the menu bar with : " File Edit View Insert Tools Desktop Window Help"
That edit?
Doesn't seem to work.
@Orion Smedley: "Edit Plot" is the first item under the "Tools" menu.
Wayne King was saying how to access it from the toolbar. It's a white arrow/pointer, and it's located in different places in different MATLAB versions.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Gefragt:

tqy
am 21 Sep. 2012

Kommentiert:

am 6 Dez. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by