Problem with drawing the plot

3 ビュー (過去 30 日間)
Ivan Khomich
Ivan Khomich 2020 年 9 月 10 日
編集済み: 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 Center および File ExchangeCreating, 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