From: SteppXXL <mm4...@sp...> - 2009-01-28 01:06:25
|
Hello there I got following set data style boxes set boxwidth 0.9 set style fill solid 1.0 set xrange [-1:] set yrange [0:] set xtics ("5" 0*6, "10" 1*6, "15" 2*6) plot "data" using ($0):($3) linetype 1, \ "" using ($0):($5>=0 ? $3 : 0) linetype 2 pause -1 "Hit return to continue" with data 5 1 32 914 2 classe(s), 1 transition(s) 5 2 16 922 2 classe(s), 1 transition(s) 5 3 8 1544 137 classe(s), 39 transition(s) 5 4 8 888 1 classe(s), 0 transition(s) 5 5 16 903 1 classe(s), 0 transition(s) 5 6 16 1139 10 1 32 1011 2 classe(s), 1 transition(s) 10 2 16 1003 1 classe(s), 0 transition(s) 10 3 32 1080 4 classe(s), 4 transition(s) 10 4 64 1047 4 classe(s), 3 transition(s) 10 5 128 1022 10 6 128 1011 1 classe(s), 0 transition(s) 15 1 256 1182 3 classe(s), 3 transition(s) 15 2 128 1393 10 classe(s), 19 transition(s) 15 3 256 1131 15 4 128 1336 8 classe(s), 16 transition(s) 15 5 64 1084 2 classe(s), 1 transition(s) 15 6 32 1144 3 classe(s), 2 transition(s) Now I urgently need to label the x-axis as written above but dynamical: At each 6-th element I need a label at x-axis namely the first column. So how to say something like plot "data" using ($0):($3):xtic(if $2==1 : $1 else "") linetype 1 Everytime the second column has the value 1 the x-axis shall get the value from corresponding value in column $1. My little example 'set xtics ("5" 0*6, "10" 1*6, "15" 2*6)' is possible because I view just a little range. The real datums will go until 10,000 ! If it's possible by a for-loop just tell me. I did not find something. My 2nd question: How to get the boxes labelled? For example each box shall contain the number of 4th column (in or over it). Regards Stepp //edit I'm wondering: "" using ($0):($2==1 ? 10 : 0):xtic($2==1 ? "1" : "") This works but I don't need the string "1" but column 1 or $1. But "" using ($0):($2==1 ? 10 : 0):xtic($2==1 ? 1 : "") or "" using ($0):($2==1 ? 10 : 0):xtic($2==1 ? $1 : "") => Tic label does not evaluate as string! And most strange "" using ($0):($2==1 ? 10 : 0):xtic(2==1 ? 1 : 2) compares whether col 2 equal col 1, if yes so label with col 1 else label with col 2. Without any '$'s it only deals with columns. -- View this message in context: http://www.nabble.com/Each-x-th-element-an-x-label-and-boxes-with-labels-tp21697428p21697428.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |