How to custmize color in fsurf

10 views (last 30 days)
Tsung- Wei
Tsung- Wei on 29 Nov 2023
Answered: Sayan on 8 Dec 2023
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.

Answers (1)

Sayan
Sayan on 8 Dec 2023
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.

Community Treasure Hunt

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

Start Hunting!