Monday, 15 August 2011

gnuplot - partition the graph depending on some integer data column -


I have a data series with two columns, time and values, and an integer number which contains an integer number, Explains that the data was received. For example

  0 15.1 0 1 20.2 0 2 34.3 1 3 41.5 2 4 61.7 1 5 79.6 0 6 48.2 0 7 92.1 1   

Now, I usually plot the first two columns with

  conspiracy "data" U1: 2 wl   

but now I want to "segment" vertical lines With graphs such as two adjacent archives having the same value as the third column, get the same background. For each value in the third column, the color of a single background is associated.

In the case of the above data, the plot would be an example, for example, the blue background color column starts from 0 to 2 times (exclusive), a green background Columns 2 to 3, one red 3 to 4, green again in 4 to 5, and so on.

Another solution (which I really like) is a vertical line in which the value of the third column changes its value, and the labels related to the value of the third column in each field of the graph (on top axes) it is said).

Any thoughts? Thanks!

Edit: An example of what I want to achieve is as follows the value of the third column has been placed at the top.

partition plot with vertical rows

top = 100 set yrange [: top] Color box set style without defining solid 1.0 set palette (0 "blue", 1 "green ", 2" red ") plot" dataet "U ($ 1 + .5): (above): 3W box LT palette," "U1: 2 YL LC-1LW 2

set palettes defines color according to the third column. The change is .5 , because the histogram is centered around its central value.

No comments:

Post a Comment