Set default to plot in a new figure

Is it possible to set the MATLAB default to automatically open plots in a new figure instead of reusing the current figure?

댓글 수: 1

José-Luis
José-Luis 2014년 9월 9일
편집: José-Luis 2014년 9월 9일
Is it an option to programmatically generate a new figure?

댓글을 달려면 로그인하십시오.

답변 (2개)

Star Strider
Star Strider 2014년 9월 9일
편집: Star Strider 2014년 9월 9일

0 개 추천

It won’t automatically do that (it can’t guess what you’re thinking, unfortunately), but you can program it to do so.
Use the figure function:
x = linspace(0,2*pi,250);
for k1 = 1:3
y = sin(k1*x);
figure(k1)
plot(x, y)
grid
axis tight
end
You can also use a variation on this theme to produce subplot axes in a figure.
Erin
Erin 2014년 9월 9일

0 개 추천

I was just wondering if there was a way to change the startup file to do it automatically when MATLAB starts.

댓글 수: 2

Star Strider
Star Strider 2014년 9월 9일
I looked through ‘Options’ and the available online documentation and couldn’t find anything on changing that default. The closest you can likely get is the newplot function. I doubt if it would work as a default anyway, since it reads the current figure’s 'NextPlot' property and acts accordingly.
jkr
jkr 2018년 5월 8일
Can this become an enhancement request please? Reuse figure as a default does all kinds of stupid things, like plotting a histogram on the axes of a prior scatterplot. These can be readily corrected, but involve unnecessary rework. The ability to create plots quickly and easily in the variable browser is a powerful convenience. Why not make it work a bit better. It seems it should be simple.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2014년 9월 9일

댓글:

jkr
2018년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by