Time-space plot with meshgrid?

조회 수: 7 (최근 30일)
Johnson
Johnson 2018년 1월 22일
편집: d7366431 2020년 5월 8일
I am given a table with three columns
x t color
0 0 10
0.1 0 9
0.2 0 11
0.3 0 3
0 0.1 10
0.1 0.1 9
0.2 0.1 11
0.3 0.1 3
The table is given by a variable P. so that x=P(:,1), t=P(:,2), color=P(:,3).
I want to make a 2D plot in which the x axis is x, the y axis is t, and every point (x,t) is colored according to the values of P(:,3) (preferably in a grey scale).
I know that in order to make a plot, I need to use meshgrid for x and t. But how can I make the "color" in accordance with the values after using the meshgrid?
Hope I made myself clear
Thanks in advance !
  댓글 수: 1
d7366431
d7366431 2020년 5월 8일
편집: d7366431 2020년 5월 8일
I need to plot similar chart. Could you please guide me how should I do the meshing?
Is there any examples on how to create these charts ?

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

채택된 답변

Star Strider
Star Strider 2018년 1월 23일
Try this:
figure(1)
scatter(P(:,1), P(:,2), [], P(:,3), 'Filled')
grid on
colormap(jet(10))
  댓글 수: 2
Johnson
Johnson 2018년 1월 23일
Great ! Thanks a lot !
Star Strider
Star Strider 2018년 1월 23일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by