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