add an ellipse line into pcolor plot

4 visualizaciones (últimos 30 días)
Juraj
Juraj el 16 de En. de 2014
Respondida: Juraj el 16 de En. de 2014
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.

Respuesta aceptada

Juraj
Juraj el 16 de En. de 2014
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

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by