Removing lines in scatter plot when using shading interp
조회 수: 5 (최근 30일)
이전 댓글 표시
I'm using scatter and pcolor in the same axis but on different data. When I run shading interp on the pcolor plot, colored lines are plotted connecting all the scatter points on the other data. Here is an example:
[X,Y,Z] = peaks(30);
scatter(X(:),Y(:),20,Z(:),'filled')
shading interp
Does anyone know a way to get rid of those lines? while still preserving the way pcolor looks in the same axis?
Thanks
Ashley
댓글 수: 1
Walter Roberson
2012년 7월 12일
Sorry, I do not see the pcolor()? pcolor() is a routine to create pseudo-color plots; you do not appear to have invoked it. pcolor() is not at all the same as shading interp.
답변 (2개)
Kelly Kearney
2012년 7월 12일
The shading command affects all surface and patch objects, including the child patch object that's part of a scattergroup object. You can manually set the edge color of that patch back to it's default value:
[X,Y,Z] = peaks(30);
pcolor(X,Y,Z+10);
hold on
hs = scatter(X(:),Y(:),20,Z(:),'filled');
shading interp;
set(get(hs,'children'), 'edgecolor', 'none')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!