Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing range of xtics by multiplying each x label

414 views
Skip to first unread message

Stephen Eglen

unread,
Oct 26, 1995, 3:00:00 AM10/26/95
to
Hello, If I have one column of data in a file called "count" such as:
4
5
1
3
4
5
6
7


If I just do: plot 'count'
then I get a graph with the x axis labelled from 0:7 on the xaxis.
How can I change this so that it multiplies every x axis label by 50,
so that the axis reads 0,50,100,150,200...350 instead of 0..7?
I am aware of using set xtics, but doing something like
set xtics ("0", 0, "50", 1, "100", 2..) doesnt seem like a very
general solution. Does anyone have any good ideas?

Cheers, Stephen Eglen

--

Luciano Colombo

unread,
Oct 27, 1995, 3:00:00 AM10/27/95
to
In article <46otd4$i...@infa.central.susx.ac.uk>, step...@cogs.susx.ac.uk (Stephen Eglen) writes:
>Hello, If I have one column of data in a file called "count" such as:
>4


You can try

gnuplot> plot "< awk '{ print $1*50 }'"

Of course, you need awk and a gnuplot compiled with the possibility to read from a pipe but that's quite a standard in U*ix world... Hope it helps.


crawford richard

unread,
Oct 27, 1995, 3:00:00 AM10/27/95
to
step...@cogs.susx.ac.uk (Stephen Eglen) writes:

> Hello, If I have one column of data in a file called "count" such as:
> 4
> 5
> 1
> 3
> 4
> 5
> 6
> 7
>
>
> If I just do: plot 'count'
> then I get a graph with the x axis labelled from 0:7 on the xaxis.
> How can I change this so that it multiplies every x axis label by 50,
> so that the axis reads 0,50,100,150,200...350 instead of 0..7?
> I am aware of using set xtics, but doing something like
> set xtics ("0", 0, "50", 1, "100", 2..) doesnt seem like a very
> general solution. Does anyone have any good ideas?
>
> Cheers, Stephen Eglen

I fear that in gnuplot 3.5 there is no particularly elegant solution --
an explicit "set xtics" is about the best you can do.

3.6, however, makes it easy. Get it from cmpc1.phys.soton.ac.uk. But of
course it's still in beta-testing, so you may have to jump a few hurdles.

Dick Crawford, aka rccra...@lanl.gov

David Denholm

unread,
Oct 27, 1995, 3:00:00 AM10/27/95
to
Luciano Colombo (lcol...@serd.cscs.ch) wrote:

> In article <46otd4$i...@infa.central.susx.ac.uk>, step...@cogs.susx.ac.uk (Stephen Eglen) writes:
> >Hello, If I have one column of data in a file called "count" such as:
> >4
>


> You can try

> gnuplot> plot "< awk '{ print $1*50 }'"

> Of course, you need awk and a gnuplot compiled with the possibility to read from a pipe but that's quite a standard in U*ix world... Hope it helps.

I think you want something closer to

plot "<awk '{ print (NR-1)*50, $1 }'"

since it's the missing datum that wants to be scaled up...

dd
--
david....@insignia.co.uk
Tel (01494) 453376 (work) (01494) 459742 (home)

0 new messages