Peter
Peter

Reputation: 11

GNU Plot: plotting 3D-Data in colored 2D-Plot

I have 3D-Data, and I plot all Data in a 2D-x-y-Plot (like a view in the x-y-plane into the z-direction). The command looks like:

"plot 'C:\Data.DAT' matrix nonuniform u 1:3 with lines lc rgb "black" smooth unique"

It works fine, and of course all data is plotted in black but I'd like to have a plot with a different color for each 2D-graph. Some kind of an automatic color gradient.

The data structure looks like:

    Number of 2D-Graphs /Tab/ x-Axis tick1 /Tab/  x-Axis tick2 ...
    y-Axis tick1        /Tab/ Data [1,1]   /Tab/  Data [1,2] ...
    y-Axis tick2        /Tab/ Data [2,1]   /Tab/  Data [2,2] ...
    ...

Is this possible?

Upvotes: 1

Views: 1298

Answers (1)

anatp2015
anatp2015

Reputation: 170

Yes it is possible! It's called the pm3d or color map. It's pretty simple to use, although I had some problems using it in Mac OS I was successful in Linux. I would explain it to you but when I did my research I found this post and I think it explains better than I would. Check it at: http://valavanis-research.blogspot.pt/2012/06/plotting-spectral-maps-or-spectrograms.html

But for a quick view, your data will be arranged in a 3 column file with the format:

xValue yValue zValue

x2Value y2Value z2Value

The configuration file is very easy just set it to "set pm3d map" and the rest is just regular gnuplot configuration.

Upvotes: 1

Related Questions