2 axes in GUI, permanently set the max and min values of the X and Y Coordinates.
조회 수: 1 (최근 30일)
이전 댓글 표시
I have 2 axes in a GUI, axes1 and axes2.
I have the sizes of the axes set. When I hit "Run Figure," the size of axes1 changes (becomes a 1X1 square).
I want to keep the size of axes1 the same, but change the maximum and minimum values for the y and x coordinate axes while keeping the scale of the axes1 the same. I start with this,
but when I hit "run figure" I get this, where the size of the axes has changed.:
Also, now I want to set the max and min for the x and y coordinates, but
axes(handles.axes1)
axis([0 300 0 100]);
does something that causes axes to disappear entirely. Please help!!
Thank you!
Also, if I want set a patch to axes2, how do I do that?
댓글 수: 0
답변 (2개)
Ben11
2014년 7월 14일
To manually set the x and y-limits of an axes you can use this command:
set(handles.axes1,'XLim',[0 300],'YLim',[0 300]);
Also what do you mean by "set a patch to axes2"? I would say:
axes(handles.axes2);
...draw the patch object
Is it what you mean? If not please add a bit more details :)
Matt
2014년 7월 15일
댓글 수: 2
Ben11
2014년 7월 15일
Ok maybe the axes resizing is due to the units used which may be different between axes. For instance are you sure all the axes are in "pixels" units? It might also be that their "xlimmode" or "ylimmode" properties are set to auto instead of manual; it once happened to me so that would be my guess.
Otherwise could you post a bit of code from your pushbutton "Run Figure"? That would help a lot to diagnose the problem better.
Thanks!
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!