|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Several horizontal linesHi, I look for orientation on how to plot a graph I have seen no examples for. Imagine you have this data consisting of tower_name+tower_height: Burj Dubai, 818 KVLY-TV mast, 628.8 CN Tower, 553.3 Sears Tower, 527.3 Taipei 101, 509.2 I want a graph with 5 horizontal lines, each at the height specified by the second parameter. Similar in nature to this graph: https://eshu.ubuntu-eu.org/cgi-bin/munin-cgi-graph/ubuntu-eu.org/eshu/smart_sdb-month.png I could do manually: plot 818 title "Burj Dubai", 628.8 title "KVLY-TV mast", 553.3 title "CN tower", 527.3 title "Sears Tower", 509.2 title "Taipei 101" But I want the data to be read from a file. Can this be done with a gnuplot command? Thanks, Daniel ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com _______________________________________________ Gnuplot-info mailing list Gnuplot-info@... https://lists.sourceforge.net/lists/listinfo/gnuplot-info |
|
|
Re: Several horizontal linesyou need gnuplot 4.3-cvs
set datafile separator "," t="" plot for [i=0:4] 'ts.dat' us ((i==0&&$0==0)?(b=$2,t=stringcolumn(1)):99 , $0==0?(a=b):99, $0==(i+1)?(b=$2,t=stringcolumn(1)):99 , $0):(a) with lines title t
|
|
|
|
|
|
Re: Several horizontal linessimpler ways - 'outside' gnuplot, maybe, but 'inside', i don't think so,
because you read y-values in, which are then to be used as constant functions after reading them in, that's somehow a 'misuse' of gnuplots plotting mechanism. 'outside' gnuplot, e.g.: load "< awk --field-separator \",\" 'BEGIN {temp = sprintf(\"plot\")} {if (NR>1) temp = temp \",\" ; temp = temp $2 \" title \" \"\\\"\" $1 \"\\\"\"} END{print temp}' ts.dat"
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |