how to plot y=f(x1,x2) in 3D

조회 수: 4 (최근 30일)
Amjad Green
Amjad Green 2018년 3월 20일
댓글: Walter Roberson 2018년 3월 20일
plot3 is just linking the points, i want the answer more like a surface,the function is not linear.it can be any order
also is there a way to draw in more than 3D if im working with x1,x2,x3,x4...?

채택된 답변

Walter Roberson
Walter Roberson 2018년 3월 20일
If f is a function handle, consider using fsurf()
"is there a way to draw in more than 3D"
For more than 3D you need to encode a dimension as one of the attributes of what you draw. The available attributes are:
  • x
  • y
  • z
  • color (for surfaces and images)
  • transparency
and
  • marker size
  • marker shape
  • marker face color
  • marker edge color
Using color to represent dimension is very common, but really it has hidden difficulties; I recommend reading https://blogs.mathworks.com/steve/2014/10/20/a-new-colormap-for-matlab-part-2-troubles-with-rainbows/ .
Using transparency together with color is risky. Transparency against a white background affects brightness (well, saturation perhaps technically), but if you are already encoding dimension through brightness then it can be difficult for someone to tell the difference between a transparency difference and a brightness difference.
My personal practice is:
  • for three spatial dimensions and one data dimension, represent the data by color, with transparency set constant so that you can see objects "behind" the front ones
  • otherwise, encode as x, y, z, marker face color, marker size
If you have more than 5 continuous dimensions then you probably cannot reasonably represent the data in a single graph.
I find altering marker edge color to be effectively unreadable.
If one of your dimensions is discrete with no more than about 6 cases, or can reasonably be made discrete, then it can be encoded through marker shape. marker shape is not typically perceived as continuous: you can encode difference through marker shape, but people are probably not going to understand value encoded through marker shape. You could code using the markers . v s p h (circle, triangle, square, pentagon, hexagon), but in my experience people will not be able to count sides and mentally resolve that as a spatial dimension.
  댓글 수: 2
Amjad Green
Amjad Green 2018년 3월 20일
i think it will be for the user to see use subplots to represent the each x1,y x2,y ...
then some surfaces subplots x1,x2,y x1,x3,y ...
thanks a lot much appreciated
Walter Roberson
Walter Roberson 2018년 3월 20일
https://www.mathworks.com/help/stats/gplotmatrix.html

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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