add an ellipse line into pcolor plot

4 次查看(过去 30 天)
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 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by