Problem with drawing the plot

5 Ansichten (letzte 30 Tage)
Ivan Khomich
Ivan Khomich am 10 Sep. 2020
Bearbeitet: Ivan Khomich am 10 Sep. 2020
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.

Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by