Can I set origin?

Can I set origin?

Post by Zhenhai Du » Thu, 28 Jan 1999 04:00:00



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)
--------------------------------------------------------------

 
 
 

Can I set origin?

Post by crawford richa » Thu, 28 Jan 1999 04:00:00



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?

Post by Prof. Jerry Plac » Thu, 28 Jan 1999 04:00:00


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?

Post by Zhenhai Du » Fri, 29 Jan 1999 04:00:00


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)
--------------------------------------------------------------

 
 
 

1. Setting the origin

 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
 about this.

 Oh, before I forgot... why glrect(x1,y1,x2,y2); dont work but

 glbegin(GL_POLYGON);
 glVertex2s(x1,y1);
 .....
 glEnd();

 works... Is it because it only affect the Z buffer?!
 any better methode for drawing boxs then using polygon?

 Stephan

2. GL emmulator for PC

3. Setting Origin for Points? (Center, Upper Left)

4. Showmodal and minimize

5. automatic way of setting origin/size in multiplots?

6. AVI conversion

7. Set pen origin (GDI)

8. Graphics tablets...

9. Win98 canned!!!

10. WANTED: canned edge detection routines/graphics libraries