How to custmize color in fsurf

9 次查看(过去 30 天)
Tsung- Wei
Tsung- Wei 2023-11-29
回答: Sayan 2023-12-8
I use fsurf function and I would like to custmize function.
The default of fsurf(....,"FaceColor","interp") is the interpolation on ZData.
I want to interpolate by me own data. How could I do that?
I know surf function can do the job, but when my gragh is large, I like the idea that re plot the data when zoom in when using fsurf.
It could save a lot of storage.

回答(1 个)

Sayan
Sayan 2023-12-8
Hi Tsung- Wei,
I understand from your query that you need to color the surface plot using the "fsurf" function with your customized function, like the "surf" function. However, I do not think you can do the same with "fsurf".
The reasons for this are as follows:.
  • In the "surf" function, we do not only provide the values of "x","y" and "z" but also create a "mesh" using the "meshgrid" function before passing them. This is the reason that the number of data points is pre-defined by the user, and we can pass another variable ("C") of the same size, which can color it.
  • In "fsurf," data points are not explicitly provided; instead, the function dynamically generates the data points. This is why we are unable to specify the size of "C," as can be done in the "surf" function, where data points are explicitly defined.
  • The "FaceColor" property of the "fsurf" only accepts "RGB" triplet to color the entire surface.
You can find more information on the "FaceColor" property in the following documentation.
Hope this helps in answering the query.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by