Problem with drawing the plot

5 次查看(过去 30 天)
Ivan Khomich
Ivan Khomich 2020-9-10
Hello everyone!
I have a problem with drawing a plot on an axes. For example I have code like this:
function DrawSmth
FigurePos=[60 80 1820 890];
figure('Units', 'pixels', 'Position', FigurePos,'Color', 'w', 'Tag', 'Fig', 'MenuBar', 'none');
AxesPos=[650 90 300 400];
axes(gcf, 'Units', 'pixels', 'Position', AxesPos, 'Tag', 'Graphic','Color', [1 0 0]);
x=0:0.01:2;
y=sin(x);
plot(gca,x,y);
zoom on
On a picture you can see what I get when run the code.
I get this even when I try the examples in MatlabDocumentation like this:
figure
tab1 = uitab('Title','Tab1');
ax1 = axes(tab1);
plot(ax1,1:10)
tab2 = uitab('Title','Tab2');
ax2 = axes(tab2);
surf(ax2,peaks)
If anyone can help,I'l appreciate this.
Update.
It does'nt show even this:
x=0:0.001:2*pi;
y=sin(x);
plot(x,y)
Still the empty figure window.

回答(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