surf plot of f(x,y). With gridlines, but more sparse than default

3 ビュー (過去 30 日間)
Zaheer Ali
Zaheer Ali 2021 年 12 月 14 日
回答済み: Walter Roberson 2021 年 12 月 14 日
surf(x,y,z) where z is oscillatory. Therefore x,y are 100x100. I want the gridlines (don't want to use flat or interp options). However, too many gridlines don't look good. Looking for a way to reduce gridlines by 50% or 75% etc. in both x and y coord.

回答 (2 件)

cr
cr 2021 年 12 月 14 日
編集済み: cr 2021 年 12 月 14 日
s=surf(x,y,z)
Now use s.Parent.XTick and set it to a vector. E.g.
s.Parent.XTick = 0:2:10;
will make the X-grid 2units with limits of X from 0 to 10. Similarly s.Parent.Ytick may be used to set the y-grid spacing.

Walter Roberson
Walter Roberson 2021 年 12 月 14 日
I suspect you are not talking about the "gridlines" as such: I think you are talking about the drawing of the edges of each face.
There is no direct way to control the drawing of the edges.
Use 'edgecolor', 'flat', and supply a 'CData' that includes a lof of NaN .
Use a different color for each edge based on the values in the CData property.
First you must specify the CData property as a matrix the same size as ZData.
The color value at the first vertex of each face (in the positive x and y directions)
determines the color for the adjacent edges.

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by