Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Gnuplot canvas terminal mouse coordinates Followup-To: comp.graphics.apps.gnuplot Date: Sat, 05 May 2012 09:16:39 -0700 Organization: gnuplot development team Lines: 46 Message-ID: References: <968a7822-6927-42ce-9d26-0d6e2378bb3d@r9g2000yqd.googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Sat, 5 May 2012 16:16:41 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="9422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/NqiuOITZIIWY/yYxfzGJ" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:wLznbHmS+/jGDGvzHxzQw6YEmnM= Xref: csiph.com comp.graphics.apps.gnuplot:1078 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