Why isn't ezplot holding on?

조회 수: 2 (최근 30일)
Alessio Nava
Alessio Nava 2013년 4월 23일
편집: Walter Roberson 2020년 9월 4일
% settings for figure and axis
figuraT1 = figure('Name',title,'Position', get(0,'Screensize'));
maxfig(figuraT1,1);
assiT1 = axes('Parent', figuraT1);
dim=length(fsymarr);
for i=1:dim
ezplot(fsymarr(i),[min,max],figuraT1)
hold on
end
grid on
set(assiT1, 'LineWidth',1.5);
set(assiT1,'FontSize',14,'FontWeight','bold','FontAngle','Italic');
ylabel('Y Values');
xlabel('X Values');
Why does the function ezplot plot only the last function in the array fsymarr?
  댓글 수: 4
Walter Roberson
Walter Roberson 2013년 4월 23일
What does
class(fsymarr)
show ? I need to know in order to tell you the correct solution.
Also I will need to know your MATLAB version number.
Alessio Nava
Alessio Nava 2013년 4월 24일
fsymarr is a simple vector containing explicit 2D functions expressed in symbolic vars. For example it might contain: [x^2+1, sqrt(x)]. I iterate over the vector fsymarr to plot all these functions on the same graph.
Version 2012a.

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 24일
편집: Walter Roberson 2020년 9월 4일
The only thing I see at the moment is that ezplot() automatically adjusts the plot limits in ways such that the results of the earlier plot might only be partly visible (or out of range completely.)
Try changing to "hold on" instead of "hold all" -- but note that if you do that then the limits established first will be used, possibly leaving other plots mostly out of window.
  댓글 수: 2
Alessio Nava
Alessio Nava 2013년 4월 25일
That was the problem; unfortunately I did not realize since all the graphs are complementary. I've just written some code which manages to resize the axis dinamically. Thank you very much!
Ricardo Ortega Bolaños
Ricardo Ortega Bolaños 2020년 9월 4일
Hello Alessio Nava, I have the same problems with "hold on" and "ezplot", the axes change and the graph does not come out well. Could you give me some indication about your code, I would really appreciate it. Thank you.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by