add an ellipse line into pcolor plot

4 ビュー (過去 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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by