Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Gnuplot canvas terminal mouse coordinates
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gfle...@jpl.nasa.gov  
View profile  
 More options May 3 2012, 8:21 pm
Newsgroups: comp.graphics.apps.gnuplot
From: gfle...@jpl.nasa.gov
Date: Thu, 3 May 2012 17:21:26 -0700 (PDT)
Local: Thurs, May 3 2012 8:21 pm
Subject: Gnuplot canvas terminal mouse coordinates
Hello,

I'm using the gnuplot canvas terminal, starting with some of Ethan
Merritt's demo page stuff to show some plots where the x axis goes
from, say, 3590.01 to 3590.42.  (infrared spectra with wavenumber)

The returned coordinates on the canvas and in the HTML table (mb0 and
mb1) have very poor resolution, so that it only shows 3590 wherever I
move or click the mouse.

I tried hacking the gnuplot_mouse.js file by changing the
x.toPrecision( ) call, but that didn't help.
How can I increase the resolution of the returned coordinates to
something like %9.4f

Any help is greatly appreciated!

I'm using Perl 5.10.0, Gnuplot 4.4, Apache 2.2.21, Firefox 12.0 all
running on MacOS 10.6.8


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sfeam  
View profile  
 More options May 5 2012, 12:16 pm
Newsgroups: comp.graphics.apps.gnuplot
Followup-To: comp.graphics.apps.gnuplot
From: sfeam <sf...@users.sourceforge.net>
Date: Sat, 05 May 2012 09:16:39 -0700
Local: Sat, May 5 2012 12:16 pm
Subject: Re: Gnuplot canvas terminal mouse coordinates

I'm not sure, but possibly the problem is due to the precision used
to store the axis range limits.  The mousing code calculates the
current coordinate using code equivalent to
     gnuplot_x = axis_xmin + fraction * (axis_xmax - axis_xmin)
where fraction is the fractional position along the axis derived from
the pixel representation of the axis end points and the mouse position.
These values are written at the very end of the javascript output.
The code section looks like this:
  gnuplot.plot_width = 523.9;
  gnuplot.plot_height = 363.9;
  gnuplot.plot_axis_xmin = -10;
  gnuplot.plot_axis_xmax = 10;
  gnuplot.plot_axis_ymin = -1.5;
  gnuplot.plot_axis_ymax = 1.5;

As an experiment, you could try editing in additional decimal places to
these values in the *.js file.  They needn't be _correct_ digits;
the purpose of the experiment is to see if that results in additional
precision in the mouse coordinate output.  If it does, then we know
what needs to be fixed in the output code.

        Ethan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gfle...@jpl.nasa.gov  
View profile  
 More options May 7 2012, 11:57 am
Newsgroups: comp.graphics.apps.gnuplot
From: gfle...@jpl.nasa.gov
Date: Mon, 7 May 2012 08:57:03 -0700 (PDT)
Local: Mon, May 7 2012 11:57 am
Subject: Re: Gnuplot canvas terminal mouse coordinates
Thanks very much for the reply.  The javascript output showed

-------------
// plot boundaries and axis scaling information for mousing
plot_term_xmax = 600;
plot_term_ymax = 400;
plot_xmin = 96.0;
plot_xmax = 575.9;
plot_ybot = 368.0;
plot_ytop = 30.1;
plot_width = 479.9;
plot_height = 337.9;
plot_axis_xmin = 3589.7;
plot_axis_xmax = 3590.4;
plot_axis_ymin = 0.1;
plot_axis_ymax = 1e+08;
plot_axis_x2min = "none"
plot_axis_y2min = "none"
plot_logaxis_x = 0;
plot_logaxis_y = 1;
plot_axis_width = plot_axis_xmax - plot_axis_xmin;
plot_axis_height = plot_axis_ymax - plot_axis_ymin;
------------

which look reasonable.  I tried editing those values for the test with
more decimal places but it didn't change anything.
The X axis continues to report values with no decimal places.

For another clue, I just did a plot where the x axis goes from 3593.3
to 3594.2 and I noticed that along with low resolution it appears to
be mapping incorrectly.
The X values changes from 3593 to 3594 when I move around 3593.5
instead of in the neighborhood of 3594.   BUT the Y values are spot
on.  ???

I should mention that I do these graphs all the time with the X11
driver and the mousing resolution works fine.  And, since Gnuplot is
properly labeling the canvas graph, I think it's getting the right
numbers from me.
Is there a Gnuplot-related canvas driver variable that would limit
resolution?  Anything I can set/show?

Thanks again!
Greg.

Is

On May 5, 9:16 am, sfeam <sf...@users.sourceforge.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gfle...@jpl.nasa.gov  
View profile  
 More options May 7 2012, 12:09 pm
Newsgroups: comp.graphics.apps.gnuplot
From: gfle...@jpl.nasa.gov
Date: Mon, 7 May 2012 09:09:42 -0700 (PDT)
Local: Mon, May 7 2012 12:09 pm
Subject: Re: Gnuplot canvas terminal mouse coordinates
Hello again.  I sent a reply post, but don't see it yet, hopefully it
gets through.

Ethan, I just noticed on your demo page that the X value is always 4
significant figures.  For plots that have a small X range, the
resolution is 4 sig figs (e.g. 0.04406).
For other graphs with a larger range the resolution is lower (e.g.
15.07)  So, hopefully that's a variable that be can be set and not a
hard-coded printf e.g. %4e or something like that.).

Again, thanks for all the help.
Greg.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sfeam  
View profile  
 More options May 7 2012, 3:24 pm
Newsgroups: comp.graphics.apps.gnuplot
Followup-To: comp.graphics.apps.gnuplot
From: sfeam <sf...@users.sourceforge.net>
Date: Mon, 07 May 2012 12:24:18 -0700
Local: Mon, May 7 2012 3:24 pm
Subject: Re: Gnuplot canvas terminal mouse coordinates

gfle...@jpl.nasa.gov wrote:
> I should mention that I do these graphs all the time with the X11
> driver and the mousing resolution works fine.  And, since Gnuplot is
> properly labeling the canvas graph, I think it's getting the right
> numbers from me.

The mouse coordinates in X11 are calculated and printed by gnuplot itself,
which is written in C and uses C language output formats.

The mouse coordinates from the canvas terminal as displayed in a browser
are calculated and printed by the browser's javascript interpreter using
the code in gnuplot_mouse.js.  

So there's no overlap in the code, and it's not so surprising that the
result is not identical.

> Is there a Gnuplot-related canvas driver variable that would limit
> resolution?  Anything I can set/show?

You can change the number of decimal places that are printed by replacing,
for example,  x.toPrecision(4)  with x.toPrecision(8) in gnuplot_mouse.js.
However, if the underlying problem is accuracy rather than precision then
that's not going to help. It is possible, for example, that the browser
updates the mouse position in coarser increments than 1 pixel.  
I know that's true for the mouse wheel, but I don't know any details about
general mouse tracking in a browser.

A similar issue was raised recently on the developer's mailing list with
regard to mouse tracking in SVG documents.  There again both the number
of decimal places and the precision with which the current mouse position
is provided by the document viewer are relevant.

> The X values changes from 3593 to 3594 when I move around 3593.5
> instead of in the neighborhood of 3594.

Maybe a difference in rounding floats to ints in javascript v. C?

        Ethan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gfle...@jpl.nasa.gov  
View profile  
 More options May 7 2012, 5:14 pm
Newsgroups: comp.graphics.apps.gnuplot
From: gfle...@jpl.nasa.gov
Date: Mon, 7 May 2012 14:14:20 -0700 (PDT)
Local: Mon, May 7 2012 5:14 pm
Subject: Re: Gnuplot canvas terminal mouse coordinates

Well, I tried changing the x.toPrecision() functions again (out of
desperation) and this time it seems to work!  (I had already tried
that in my first post)
My browser crashed and I had to restart it in the middle of all
this ... maybe something cached?
Anyway, things are looking good now.

Ethan thanks for your help and for making these very useful javascript
pages available.

Greg Flesch


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »