## Can I set origin?

### Can I set origin?

I ran into a problem on how to set origin. say, I have the following data:

0  1 0 3
1  2 4 9

The first column is x-axies, somehow I need to skip the first row, so I

set xrange [1:..]

This moves the origin to (1,0), But i still need to keep the origin at
(0,0).

How can I do that?

--Zhenhai
--------------------------------------------------------------

Computer Science Department     http://www.cs.umn.edu/~duan
University of Minnesota, TC     Phone: (612)626-7526(O)
--------------------------------------------------------------

### Can I set origin?

Quote:> I ran into a problem on how to set origin. say, I have the following data:

> 0  1 0 3
> 1  2 4 9

> The first column is x-axies, somehow I need to skip the first row, so I

> set xrange [1:..]

> This moves the origin to (1,0), But i still need to keep the origin at
> (0,0).

> How can I do that?

You'll need to filter the data.  In gnuplot 3.5, there aren't any fancy
commands that will let you do this directly, but if your system supports
redirection you can run the filter from within the "plot" command.

For instance, if you write a little script "*" which simply ignores
the first line and echoes everything else to STDIN, then
set xrange [0:...]
plot "< *"
will do the trick.

If you are using gnuplot 3.7, you can do this completely with gnuplot commands.
set xrange [0:...]
plot 'data' using 1:(\$0>0?\$2:0/0)
where the ternary operator syntax is
condition ? do this if true : do this if false
(gnuplot will quietly ignore the unplottable value "0/0") and "\$N" refers to
the value in column #N; N=0 refers to the line number.

### Can I set origin?

I think what you want will be accomplished by the following in your plot
statement:

plot [0:1000] [0:.20]  ...

The first sequence ``[0:1000]'' sets x-axis points while the second
sequence ``[0:.20]'' sets the y-axis plot points.

Good luck!

-- Jerry Place
-- CSTP

> I ran into a problem on how to set origin. say, I have the following data:

> 0  1 0 3
> 1  2 4 9

> The first column is x-axies, somehow I need to skip the first row, so I

> set xrange [1:..]

> This moves the origin to (1,0), But i still need to keep the origin at
> (0,0).

> How can I do that?

> Please CC to me, Thanks.
> --Zhenhai
> --------------------------------------------------------------

> Computer Science Department        http://www.cs.umn.edu/~duan
> University of Minnesota, TC        Phone: (612)626-7526(O)
> --------------------------------------------------------------

>  - -
> [[[[ to unsubscribe from info-gnuplot, send an email with body
> unsubscribe info-gnuplot

> ]]]]

### Can I set origin?

I ran into a problem on how to set origin. say, I have the following data:

0  1 0 3
1  2 4 9

The first column is x-axies, somehow I need to skip the first row, so I

set xrange [1:..]

This moves the origin to (1,0), But i still need to keep the origin at
(0,0).

How can I do that?

--
--Zhenhai
--------------------------------------------------------------

Computer Science Department     http://www.cs.umn.edu/~duan
University of Minnesota, TC     Phone: (612)626-7526(O)
--------------------------------------------------------------

I have a feeling this is a common question...

OpenGL set the origin at the middle of the window by default,
go positive upward for Y, and positive leftward for X.
But I come from a 2d world where the drawing origin is in the
TopLEft, (based on memory addressing ) Same rule for X for
wrong origin on direction for Y.

Curently I use glTranslate(-width/2,height-height/2,0) and negate
my Yx value on each gl call...
is there a better way? I didn't find any mention about the origin beying
anywhere else then the bottom left (But then by default 0,0 is in the
middle of the window???... but I think I remember in old Iris book reading