Symbol issue superposing plot and pcolor

조회 수: 5 (최근 30일)
Stanislav Stefanovski
Stanislav Stefanovski 2014년 5월 20일
댓글: Stanislav Stefanovski 2014년 5월 20일
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

채택된 답변

Kelly Kearney
Kelly Kearney 2014년 5월 20일
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
Stanislav Stefanovski
Stanislav Stefanovski 2014년 5월 20일
Hi
I am not sure about how to use "set" correctly.
I tried and I receive the following error :
"Value cell array handle dimension must match handle vector length"
no matter how I write it
Stanislav Stefanovski
Stanislav Stefanovski 2014년 5월 20일
I found out what's the problem !
:)
Thank you a lot !!!

댓글을 달려면 로그인하십시오.

추가 답변 (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