I need a hand with some graph function... :O

Is there a way to use the 'hold' command to keep only selected graphs and get rid of the others?
Thanks in advance

 采纳的回答

I am not certain what you want to do. You may not need to use hold at all.
Try this:
x = linspace(-1, 1);
figure(1)
L1 = line('XData',x, 'YData',2*x);
L2 = line('XData',x, 'YData',x.^2);
set(L1, 'LineStyle','none') % Using ‘set’
L1.LineStyle = 'none'; % Using Structure
grid

4 个评论

set(L1, 'LineStyle','none')
L1.LineStyle = 'none';
I'm not really proficient with MATLAB, could you explain me what these two lines do please?
Thanks
They essentially render ‘L1’ invisible by setting the 'LineStyle' to 'none', or no plotted line.
The information remains in your workspace, however the ‘L1’ line (x,y) values depicting it are not plotted.

Thanks Star Strider! Top man!

As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Networks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by