How to make a figure current? How to make an axes current?

 


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:  

    1. First make the relevant figure current.

    2. 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)?


NOTE:-


Matlabhelpers.com provide latest MatLab Homework Help,MatLab Assignment Help , SIMULINK APPLICATIONS HELP  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.  

Answers: 


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 

 

Comments

Popular posts from this blog

How to Perform LU Decomposition with Partial Pivoting in Matlab

Why Red, Green, Blue channels of image separetely are grayscaled (Matlab)?

How to MATLAB: Extract multiple parts of a matrix without using loops