Is it possible to draw a plot in a frame uicontrol in MATLAB?

3 次查看(过去 30 天)
I would like to draw a plot in a frame uicontrol in MATLAB. How can this be done using MATLAB 7.0 (R14)?

采纳的回答

MathWorks Support Team
It is not possible to draw a plot on top of a frame uicontrol in MATLAB. However, it is possible to place axes objects on top of UIPANEL objects (which were introduced in MATLAB 7.0 (R14)).
It is not possible to display an axes on top of a frame uicontrol because the uicontrols are placed over the figure window rather than within the figure window. Therefore, the frame uicontrol will always be drawn on top of the axes.
If you are using a version of MATLAB prior to 7.0, or if you want to use a frame uicontrol with MATLAB 7.0 instead of a uipanel, you may want to create a second axes and set its color so that it is similar to the frame color.
For example:
figure;
h_frame = uicontrol('style','frame');
frame_color = get(h_frame,'BackGroundColor');
delete(h_frame)
ax_frame = axes('color',frame_color,'ytick',[],'xtick',[]);
box on;
ax_plot = axes('position',[.2 .2 .5 .6])
plot(1:10)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by