필터 지우기
필터 지우기

How can I change the axes properties in GUI created by guide?

조회 수: 4 (최근 30일)
Hessam
Hessam 2014년 10월 7일
답변: Sean de Wolski 2014년 10월 13일
Hello there
I change the Inspector setting for axes in my GUI. After running the GUI figure, the font size and the range is the same as the one I have already specified. But when I implement the GUI, the plot shows in the axes with different font size!
the following in the push-button plots the figure.
axes(handles.axes1)
plot(x, pcenergy);
pcenergy is the dataset.
Thank you in advance for your help.
Hessam
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2014년 10월 7일
Hessam - what do you mean by ..and the range? I created a simple GUI, set the font size through the inspector, run the GUI and plotted some data on the axes, and there were no changes to the font sizes.
If you want to reset the font size, then try adding the following line after your plot command
set(handles.axes1,'FontSize',14);
or whatever your preferred font size is.
Hessam
Hessam 2014년 10월 10일
First: sorry for being late in response. I mean: I go to the "Inspector" window for the axes, and change the font size, minor/major grid lines of the axes. and the changes are effective at the GUI. But when I run the GUI and the figure is plotted, the font size and everything else' setting are back to the default ones!!

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

답변 (2개)

Orion
Orion 2014년 10월 13일
Hi,
you can change the default font size directly in Matlab.
in your OpeningFcn, you can add
set(0,'DefaultUicontrolFontSize',15)
So every button you create, will automatically be set with this font size.
  댓글 수: 1
Hessam
Hessam 2014년 10월 13일
Hi there
But, I do not want to Change the font of everything consistently. As I said, I do not know how to keep the setting in the Inspector window, consistent.

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


Sean de Wolski
Sean de Wolski 2014년 10월 13일
Calling plot will clear some of the axes settings. You could either use hold on to hold the axes properties or instead of calling plot, call line directly.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by