Time-space plot with meshgrid?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Johnson
am 22 Jan. 2018
Bearbeitet: d7366431
am 8 Mai 2020
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 Kommentar
Akzeptierte Antwort
Star Strider
am 23 Jan. 2018
Try this:
figure(1)
scatter(P(:,1), P(:,2), [], P(:,3), 'Filled')
grid on
colormap(jet(10))
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!