obtain "gca" and "gcf" from an existing fig file, which was generated by "plotyy"

조회 수: 3 (최근 30일)
Dingguo Lu
Dingguo Lu 2012년 9월 13일
I plan to modify the exiting fig and therefore, the "gca" and "gcf" information is needed. but get(gca) is only valid for the first layer of the plot. But I also want modify the second layer.
so how can I get information for both layers, i.e., gca1 and gca2?
Thanks

답변 (2개)

Walter Roberson
Walter Roberson 2012년 9월 13일
FigureNumber = openfig('TheName.fig');
axes_handles = findobj(FigureNumber, 'type', 'axes');
  댓글 수: 2
Dingguo Lu
Dingguo Lu 2012년 9월 14일
Thanks first!
However, FigureNumber = openfig('TheName.fig'); will move one layer from original place. Is there any way to correct it?
Walter Roberson
Walter Roberson 2012년 9월 14일
openfig() will create a figure. Figures are never nested. The created figure will be at exactly the same layer as it was when it was created. The only difference may be in the figure number.

댓글을 달려면 로그인하십시오.


per isakson
per isakson 2012년 9월 14일
편집: per isakson 2012년 9월 14일
The doc (R2012a) says:
[AX,H1,H2] = plotyy(...) returns the handles of the two axes created
in AX and the handles of the graphics objects from each plot in H1 and
H2. AX(1) is the left axes and AX(2) is the right axes.
  댓글 수: 1
Dingguo Lu
Dingguo Lu 2012년 9월 14일
The plot has already been generated by "plotyy". I wanna to modify the existing figure.
Thanks all the same.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by