4D plot with matlab

조회 수: 9 (최근 30일)
Shirin Muhammad
Shirin Muhammad 2019년 4월 1일
댓글: Adam Danz 2019년 4월 5일
I have the attached data, in which the first three columns are variables, the fourth column data was obtained as a function of the variables c1,c3, and c4.
Can any one tell me how I can plot them together?
Thank you.

답변 (2개)

Adam Danz
Adam Danz 2019년 4월 1일
편집: Adam Danz 2019년 4월 2일
It sounds like you've got data (stored in column 4) that vary on 3 axes (stored in cols 1:3). Perhaps a 3D contour plot or a 3D surface plot can be used where the (x,y,z) coordinates are defined by your columns 1,2,3 and the color is defined by the data in column 4. Check out the documentation for those functions and let us know if you get stuck.
Another option is to use a 3D scatter plot and color each marker according to the value in the 4th dimension.
figure
h = scatter3(data(:,1), data(:,2), data(:,3), 20, data(:,4), 'MarkerFaceColor', 'Flat');
colorbar();
caxis([min(data(:,4)), max(data(:,4))])
  댓글 수: 18
Shirin Muhammad
Shirin Muhammad 2019년 4월 5일
편집: Shirin Muhammad 2019년 4월 5일
Is there any one who can help me by ploting the data data1.png using contour3?
thanks
Adam Danz
Adam Danz 2019년 4월 5일
After recommending contour3() I realized this isn't really an option since it only receives (X,Y,Z) values. My initial thought was to change the colors to your values in the 4th column but I'm no longer sure that's possible. I looked at the 2nd output to contour3() which is the handle to the plot and it wasn't immediately apparent how to access and change the color values.

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


Shirin Muhammad
Shirin Muhammad 2019년 4월 2일
I don't have any preference to use contour3 . My data is attached. thank you for your time.

카테고리

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