Options of pcolor lines

18 ビュー (過去 30 日間)
Andreas Christensen Sørensen
Andreas Christensen Sørensen 2018 年 12 月 18 日
回答済み: Walter Roberson 2018 年 12 月 28 日
Hi i have this plot made with pcolor. Is there a way to only include grid lines for the bounded values, I have a lot on NaN values which should not be boxed
best regards

回答 (2 件)

Akshay Khadse
Akshay Khadse 2018 年 12 月 28 日
As per my knowledge, it not possible to selectively hide the grid in this case. Following are the two alternatives:
1) Hide the entire grid by using the following:
h = pcolor(X,Y,C);
h.EdgeColor = 'none';
2) Change the X axis limits by using the following:
h = pcolor(X,Y,C);
xlim([-0.6 0.6])
ylim([-0.6 0.6])
This could also be done using the follwing command
axis([-0.6 0.6 -0.6 0.6])

Walter Roberson
Walter Roberson 2018 年 12 月 28 日
pcolor is internally aa call to surf() with edgecolor none followed by aa call to view(2)
so.. turn your grid off and call surf without the edgecolor option and then view(2)
surf puts in edges between any two horizontally or vertically adjacent locations that are both non nan.
surf only puts in faces if aa 2x2 block is all non nan.
It is possible to end up with edges between faces that are not drawn. Yesterday II posted code that would clean up the stray edges using aa simple imopen or imclose

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by