Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #650

Re: How to extract point data.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: How to extract point data.
Followup-To comp.graphics.apps.gnuplot
Date Wed, 19 Oct 2011 14:42:57 -0700
Organization gnuplot development team
Lines 58
Message-ID <j7ng93$t8u$1@dont-email.me> (permalink)
References <31706069.122.1319044340309.JavaMail.geo-discussion-forums@yqoo7>
Reply-To sfeam@users.sourceforge.net
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
Injection-Date Wed, 19 Oct 2011 21:43:00 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="joalffpZlyHxFtpFd/PRrw"; logging-data="29982"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19s2bKOm6timxkxXhXLtiKb"
User-Agent KNode/4.4.9
Cancel-Lock sha1:LgmbidDSGwtEFiS0wKZA9ShJpe4=
Xref x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:650

Followups directed to: comp.graphics.apps.gnuplot

Show key headers only | View raw


Naren wrote:

> I have a data file containg values of X and Y data.
> 
> Example (Y = 2X)
> 
> X	Y
> 
> 1	1
> 2	4
> 3	6
> 4	8
> 5	10
> 6	12
> 
> When I plot the data I get a nice curve.
> 
> However what I want is to get the Y-value for a given X-value. Is it
> possible to extract.
> 
> Additionaly, the (X,Y) pair may not be explicity present in the file.
> 
> For eg X = 4.5 in the above case. Is it possible to get the Y value for X
> = 4.5 from the above data set and store it in a variable.

The generic answer is that whenever you click on the plot display with
the mouse (assuming you are using an interactive display mode, of course)
it saves information about the mouse-click in a set of special variables.
Here's what I get after opening up a plot and clicking the mouse in it.
gnuplot> show variable MOUSE
        Variables beginning with MOUSE:
        MOUSE_X = 2.23883206574001
        MOUSE_Y = -3.34830115252208
        MOUSE_X2 = 2.23883206574001
        MOUSE_Y2 = -3.34830115252208

You can do much more than that, however.  For instance if I tell gnuplot
gnuplot> pause mouse key
Then typing a character in the plot window will save not only the coordinates
but also information about what was typed.  Here I type the "A" key:
gnuplot> show variable MOUSE
        Variables beginning with MOUSE:
        MOUSE_X = 2.23883206574001
        MOUSE_Y = -3.34830115252208
        MOUSE_X2 = 2.23883206574001
        MOUSE_Y2 = -3.34830115252208
        MOUSE_SHIFT = 0
        MOUSE_ALT = 0
        MOUSE_CTRL = 0
        MOUSE_KEY = 65
        MOUSE_CHAR = "A"

In the gnuplot distribution there is a demo script called
  mouselabels.dem
that shows how you can set up a script to interact with a plot using
the mouse, including saving the coordinates of specific points that you
have clicked on.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-19 10:12 -0700
  Re: How to extract point data. Oliver Jennrich <oliver.jennrich@gmx.net> - 2011-10-19 23:38 +0200
    Re: How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-20 00:05 -0700
      Re: How to extract point data. Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2011-10-21 22:54 +0200
  Re: How to extract point data. sfeam <sfeam@users.sourceforge.net> - 2011-10-19 14:42 -0700
    Re: How to extract point data. Naren <a.narendiran@gmail.com> - 2011-10-20 00:08 -0700
      Re: How to extract point data. James Cloos <cloos@jhcloos.com> - 2011-10-20 19:34 -0400
      Re: How to extract point data. Ingo Thies <ingo.thies@gmx.de> - 2011-10-21 09:02 +0200
  Re: How to extract point data. ab <ab.3942@googlemail.com> - 2011-10-27 00:46 -0700

csiph-web