Message Boards Message Boards


Coloring ListLinePlot based on a 3rd value

Posted 9 years ago
1 Reply
0 Total Likes

Hi I have x=longitude and y=latitude values and a z=velocity values that are stored as follows I have a list of lists { { {x11,y11,z11},{x12,y12,z12} ,.... },{ {x21,y21,z21},{x22,y22,z22},...... },... } and I am trying to create a line plot of y vs x using the z values to drive the colour of the line, for each of the lists { {xi1,yi1,zi1},{xi2,yi2,zi2} ,.... }.

For further Clarification.

The overall list contains sublist each of which is a single day's worth of data measurements which have been binned based on latitude and all values in each bin have been averaged. Using these {x,y,z} sets I want a plot to achieve the following Where data is the over all list, and i represent which day it is And on a single plot I would need each day to be its own line which would be shown by the something similar to this ListLinePlot[Data[[i,x,y]],ColorFunction-> Hue[z]]

If you know GNUplot It would roughly be plot index i using 1:2:3 w lp palette 1=x, 2=y, 3=z

So this would yield a line plot of the xy points that have a color gradient to show the current value of z. In other words I am trying to show how the z value changes as w Any help would be appreciated. Thanks

POSTED BY: Andrew Eriksen

Hi, Andrew, It is not quite clear what are you after. in your first list, { { {x1,y1,z1},{x2,y2,z2},...} you have different values of z, so how do you imagine yourself the coloring? Further, your second list is exactly the same as the first one. You probably have in mind something different? It would be helpful, if you give a small example with numbers and with explanation, of what colors one should have there.

POSTED BY: Alexei Boulbitch
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract