If f
is the figure handle, I wanted to use plot3(..)
on it just like I would use plot(..)
, but this didn't work:
>> plot3(f, t, real(Y), imag(Y))
Error using plot3
Vectors must be the same lengths.
Then I figured out that the way to do this is to:
First make the relevant figure current.
Then use the plot3(..)
function.
I can find what the current figure is using gcf
, but how do I make a figure current (via its handle)?
ax = gca returns the current axes (or standalone visualization) in the current figure. Use ax to get and set properties of the current axes. If there are no axes or charts in the current figure, then gca creates a Cartesian axes object.
command: figure(f) %Makes the figure current. Also, if I did something like this: f = figure('IntegerHandle','off'); % With unique, non-reusable handle.
Change Axis LimitsCreate a line plot. Specify the axis limits using the xlim and ylim functions. For 3-D plots, use the zlim function. Pass the functions a two-element vector of the form [min max] .
First create two Axes objects and specify the positions. Display the box outline around each axes. Return the Axes objects as ax1 and ax2 . figure ax1 = axes('Position',[0.1 0.1 .
This method has my personal preference:
set(0, 'currentfigure', f); %# for figures
set(f, 'currentaxes', axs); %# for axes with handle axs on figure f
because these commands are their own documentation. I find
figure(f)
and the like confusing on first read -- do you create a new figure? or merely make an existing one active? -> more reading of the context is required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With