> Hiten Negandhi
> Database Administrator
> tyco/ Electronics
> Tel: (717) 810-2813
> Fax: (717) 810-2660
> MS: 194-009
> Email: hneg...@tycoelectronics.com
>
>
- -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majo...@dartmouth.edu
]]]]
Is this what you want?
Ding
File1 20
File2 10
File3 50
File4 50
File5 90
So, I want to build my xtics dynamically using the first parameter from the
datafile. I wish I could say something like this
set xtics $1
Hiten
set xtics ("File1" 1,"File2" 2,"File3" 3,"File4" 4,"File5" 5)
set xr [1:5]
plot 'data' u ($0+1):2 notitle w l
pause -1
This will give you what you want. You can generate this script
automatically.
To supress the x-axis labels:
unset xtics
To plot a one column data file using an implied
x-axis:
plot "file.ext" 0:1 with points
Does that help?
--jab
=====
John Bollinger, CFA, CMT
www.BollingerBands.com
If you advance far enough, you arrive at the beginning.
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
> --- "Negandhi, Hiten" <hneg...@tycoelectronics.com>
> wrote:
> > Hi all,
> > Is there any way in GNUPlot of plotting a
> > non-numeric or non-time data on
> > the X/Y axis?
> > For my database, I want to plot "file name" on x
> > axis, and number of
> > read/write requests for that file on the Y axis. Is
> > there any way to use
> > GNUPlot to do this?
>
> To supress the x-axis labels:
> unset xtics
>
> To plot a one column data file using an implied
> x-axis:
> plot "file.ext" 0:1 with points
This should be:
plot 'file.ext' u 0:2 w p
but your method has no xtics at all which is not what he needs.
Ding
See my attached response to an earlier question (Subject "Gnuplot" posted on
6/14 by Markus Latzel) for how to use awk to generate the tic labels
automatically (in that case for the Y axis).
Ed.
Markus Latzel wrote:
> Hans-Bernhard Broeker wrote:
> >
> > Only by a lot of manual work, so far. There's a patch to the
>
> Ok, i'll write a bash-Script for that manual work.
This'll do it:
set ytics (`awk '{printf("%s%s%s%s %d",sep,ti,$1,ti,NR-1);sep=", "}' ti="'"
datafile.dat`)
plot 'datafile.dat' using 2:0:(0.0):2 with xerrorbars pt 0
but your order of Names will be inverted since Name1 is the first (zero-th)
row.
If you want them un-inverted this would reverse the order of names in the
awk
script:
set ytics (`awk '{name[NR]=$1}END{for (i = NR; i > 0; i--)
{printf("%s%s%s%s%d",sep,ti,name[i],ti,NR-i);sep=", "}}' ti="'" tst1.dat`)
and presumably you could do something similair (or better!) with the plot
line,
or just reverse input file e.g. using "tac" on UNIX.
Ed.
But, instead of "File1" thru "File5", it can have any text like "ABC1" thru
"ABC5" also.
How can I dynamically generate the set tics command to read the data file?
Hiten
-----Original Message-----
From: Ding Li [mailto:din...@condense.seas.ucla.edu]
Sent: Tuesday, June 17, 2003 5:31 PM
To: Negandhi, Hiten
Cc: 'info-g...@dartmouth.edu'
Subject: RE: plotting non-numeric and non-time data on x axis
Suppose you data file name is 'data'
set xtics ("File1" 1,"File2" 2,"File3" 3,"File4" 4,"File5" 5)
set xr [1:5]
plot 'data' u ($0+1):2 notitle w l
pause -1
This will give you what you want. You can generate this script
automatically.
Ding
On Tue, 17 Jun 2003, Negandhi, Hiten wrote:
> My datafile looks like this:
>
> File1 20
> File2 10
> File3 50
> File4 50
> File5 90
>
> So, I want to build my xtics dynamically using the first parameter from
the
> datafile. I wish I could say something like this
>
> set xtics $1
>
>
> Hiten
>
>
> -----Original Message-----
> From: Ding Li [mailto:din...@condense.seas.ucla.edu]
> Sent: Tuesday, June 17, 2003 4:44 PM
> To: Negandhi, Hiten
> Cc: 'info-g...@dartmouth.edu'
> Subject: Re: plotting non-numeric and non-time data on x axis
>
>
> Please have a look at:
> http://t16web.lanl.gov/Kawano/gnuplot/gallery/integ2.html
>
> Is this what you want?
>
> Ding
>
>
> On Tue, 17 Jun 2003, Negandhi, Hiten wrote:
>
> > Hi all,
> > Is there any way in GNUPlot of plotting a non-numeric or non-time data
on
> > the X/Y axis?
> > For my database, I want to plot "file name" on x axis, and number of
> > read/write requests for that file on the Y axis. Is there any way to use
> > GNUPlot to do this?
> > Any help will be highly appreciated, thanks!
> >
> >
> > > Hiten Negandhi
> > > Database Administrator
> > > tyco/ Electronics
> > > Tel: (717) 810-2813
> > > Fax: (717) 810-2660
> > > MS: 194-009
> > > Email: hneg...@tycoelectronics.com
> > >
> > >
> But, instead of "File1" thru "File5", it can have any text like
> "ABC1" thru "ABC5" also. How can I dynamically generate the set
> tics command to read the data file?
See one of the other responses in this thread for a script example.
[And guys, please learn not to top-post and full-quote without
thinking about it...]
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
CVS version of gnuplot + patch #595850 from gnuplot SourceForge site.
More information and latest version of patch available at
http://www.bmsc.washington.edu/people/merritt/gnuplot
With this patched version you can generate your plot using the command
plot 'data' using 2:xtic(1) with impulses
That means "take data values from column 2 and corresponding xtic
labels from column 1".
--
Ethan A Merritt
You can write a scipt that can dynamically change the tics according to
your data files. There should be no problems with this.
Ding
On Wed, 18 Jun 2003, Negandhi, Hiten wrote:
> Thanks for your response.
>
> But, instead of "File1" thru "File5", it can have any text like "ABC1" thru
> "ABC5" also.
> How can I dynamically generate the set tics command to read the data file?
>