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. |
From: Ethan M. <merritt@u.washington.edu> - 2009-01-28 01:23:01
|
On Tuesday 27 January 2009 17:06:20 SteppXXL wrote: > > 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 plot "data" using 0:3:xtic( column(2)==1 ? stringcolumn(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). See 5th plot in demo http://gnuplot.sourceforge.net/demo_4.3/datastrings.html > > 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. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
From: SteppXXL <mm4...@sp...> - 2009-01-28 13:37:03
|
Thanks Ethan but plot "data" using 0:3:xtic( column(2)==1 ? stringcolumn(1) : stringcolumn(2) ) linetyp 1,\ doesn't work for me. It always prints the 2nd column (2nd for testing, usually "" as you wrote). followed by "" using 0:($5>=0 ? $3 : 0) linetype 2, \ "" using 0:3:4 with labels rotate by 45 center offset 0,1 notitle How to tell "Draw label only if col 4 >= x?" E.g. x=1200 for my samples. -- View this message in context: http://www.nabble.com/Each-x-th-element-an-x-label-and-boxes-with-labels-tp21697428p21705786.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
From: Ethan M. <merritt@u.washington.edu> - 2009-01-28 16:56:19
|
On Wednesday 28 January 2009 05:37:00 SteppXXL wrote: > > Thanks Ethan > > but > > plot "data" using 0:3:xtic( column(2)==1 ? stringcolumn(1) : > stringcolumn(2) ) linetyp 1,\ > > doesn't work for me. It always prints the 2nd column (2nd for testing, > usually "" as you wrote). Works here, in both version 4.2.4 and current CVS. Please post or file a bug report giving the exact input script and data file that is failing. -- Ethan A Merritt |
From: SteppXXL <mm4...@sp...> - 2009-01-29 16:29:45
|
Ethan Merritt wrote: > > Works here, in both version 4.2.4 and current CVS. > Please post or file a bug report giving the exact input script > and data file that is failing. > Ok, if you think it's a bug I posted it http://sourceforge.net/tracker/index.php?func=detail&aid=2545882&group_id=2055&atid=102055 Thank you. -- View this message in context: http://www.nabble.com/Each-x-th-element-an-x-label-and-boxes-with-labels-tp21697428p21730377.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
From: Ethan M. <merritt@u.washington.edu> - 2009-01-29 20:35:34
|
On Thursday 29 January 2009 08:29:40 SteppXXL wrote: > > Ethan Merritt wrote: > > > > Works here, in both version 4.2.4 and current CVS. > > Please post or file a bug report giving the exact input script > > and data file that is failing. > > > > Ok, if you think it's a bug I posted it > > http://sourceforge.net/tracker/index.php?func=detail&aid=2545882&group_id=2055&atid=102055 From the bug report: $ gnuplot G N U P L O T Version 4.2 patchlevel 2 last modified 31 Aug 2007 System: Linux 2.6.26-1-686 Got it. Your problem was due to a bug that was fixed some time between 4.2.2 (the one you show in your bug report) and 4.2.4 (current version, released in September of 2008). As I said, your code works fine as tested here in both 4.2.4 and current cvs. -- Ethan A Merritt |
From: SteppXXL <mm4...@sp...> - 2009-01-29 22:39:56
|
Thank you for helping. Regards Stepp -- View this message in context: http://www.nabble.com/Each-x-th-element-an-x-label-and-boxes-with-labels-tp21697428p21737485.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |