add an ellipse line into pcolor plot

조회 수: 9 (최근 30일)
Juraj
Juraj 2014년 1월 16일
답변: Juraj 2014년 1월 16일
Hello,
I have a pcolor plot which has some symmetry and I want to emphasize it by adding an ellipse to the figure (just the line) - normally I would do it like this:
t=0:0.1:2*pi;
a=26;
b=25;
x=a*cos(t);
y=b*sin(t);
plot(x,y,'--')
Now I want to add it to the existing pcolor plot. How can this be achieved? I saw some similar problems here, but wasn't able to use it to solve my problem. Thanks in advance.

채택된 답변

Juraj
Juraj 2014년 1월 16일
Nevermind, I managed to do it somehow. If anyone would be in need of something similar, here's my code:
figure
pcolor(x,y,Z);shading interp; colormap jet;axis square off
h_ax = gca;
h_ax_line = axes('position', get(h_ax, 'position'));
plot(X,Y,'g--');
set(h_ax_line, 'YAxisLocation', 'right', 'xlim', get(h_ax, 'xlim'),'ylim', get(h_ax, 'ylim'), 'color', 'none');
axis square off
Regards, Juraj

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by