Symbol issue superposing plot and pcolor
3 views (last 30 days)
Show older comments
Stanislav Stefanovski
on 20 May 2014
Commented: Stanislav Stefanovski
on 20 May 2014
Hi to all
I have some problem superposing plot and pcolor. The symbols I am trying to generate from plot don't appear the way they should once I superpose plot with pcolor.
And this is what I Get and it's aweful as hell. Bob is supposed to be a circle, Alice a triangle, and Charlie a square.
What can I do to correct the problem? Because of confidentiality I can't send the entire code but I can send you the way I generated the figure:
plot(YBob,XBob,'Om',YAlice,XAlice,'^y',YCharlie,XCharlie,'sg','LineWidth',5)
legend('Bob','Alice','Charlie')
title('Distribution Cartésienne')
xlabel('Distance (m)')
ylabel('Distance (m)')
hold on
[Xeve,Yeve]=meshgrid((yDeb:res:yFin),(xDeb:res:xFin));
pcolor(Xeve,Yeve,(PerrE));
shading interp
colorbar
axis equal square
hold off
0 Comments
Accepted Answer
Kelly Kearney
on 20 May 2014
When you add pcolor plots to an axis, which changes/sets the shading scheme used by the axis, it can sometimes change the way that the properties of other surface objects are interpreted. I've never quite figured out the rhyme or reason for this, but I've found the easiest solution is to manually set all the properties after everything is in place.
In your case, try adding these lines at the end of your code:
set(h, 'linewidth', 5, 'markersize', 15);
set(h, {'markeredgecolor', 'marker'}, {'m' 'o'; 'y' '^'; 'g' 's'});
uistack(h, 'top');
(I increased the marker size because otherwise it's almost impossible to see the marker shape with such a thick line width... is that really what you want?)
On my computer, changing the renderer via
set(gcf, 'renderer', 'zbuffer')
also makes things look a bit better, but that may be OS/graphics card dependent.
2 Comments
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!