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


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

Re: Gnuplot canvas terminal mouse coordinates

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Gnuplot canvas terminal mouse coordinates
Followup-To comp.graphics.apps.gnuplot
Date 2012-05-05 09:16 -0700
Organization gnuplot development team
Message-ID <jo3jp9$96e$1@dont-email.me> (permalink)
References <968a7822-6927-42ce-9d26-0d6e2378bb3d@r9g2000yqd.googlegroups.com>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


gflesch@jpl.nasa.gov wrote:

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



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

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


Thread

Gnuplot canvas terminal mouse coordinates gflesch@jpl.nasa.gov - 2012-05-03 17:21 -0700
  Re: Gnuplot canvas terminal mouse coordinates sfeam <sfeam@users.sourceforge.net> - 2012-05-05 09:16 -0700
    Re: Gnuplot canvas terminal mouse coordinates gflesch@jpl.nasa.gov - 2012-05-07 08:57 -0700
      Re: Gnuplot canvas terminal mouse coordinates sfeam <sfeam@users.sourceforge.net> - 2012-05-07 12:24 -0700
        Re: Gnuplot canvas terminal mouse coordinates gflesch@jpl.nasa.gov - 2012-05-07 14:14 -0700
    Re: Gnuplot canvas terminal mouse coordinates gflesch@jpl.nasa.gov - 2012-05-07 09:09 -0700

csiph-web