Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: hexadecimal mouse position? Followup-To: comp.graphics.apps.gnuplot Date: Fri, 26 Oct 2012 11:35:24 -0700 Organization: gnuplot development team Lines: 65 Message-ID: References: <32a20a28-9c24-4ab2-8f2d-67d7ac3c5a74@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: Fri, 26 Oct 2012 18:35:27 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="8e86a57dfa599721f116da4577f3d1af"; logging-data="7755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xRDpnUPdYSR5f8gtFSDtC" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:nqqk57LYxBdeSgOamiA9304HaWA= Xref: csiph.com comp.graphics.apps.gnuplot:1437 Paul Li wrote: > Thanks. Unfortunately "%x" didn't print the correct values -- perhaps > it's trying to format a floating point value. Yes, you are right. I didn't stop to check that the output was correct, only that it did in fact print hexidecimal values. If you call sprintf from the gnuplot command line then the conversion to integer happens automatically, but apparently the mousing code does not make that check. > "%a" gave the correct > values but unfortunately they were in binary scientific notation (e.g. > 0x41 was printed as "0x1.04p+6"). I don't imagine there is any way around > this? I don't know of one. If it helps any, you could use the "bind" command to attach a command line formatting function that does the job: bind h 'pause mouse; print sprintf("%x %x", MOUSE_X, MOUSE_Y)' Now if you hit the h key while the mouse is in the plot window, the next mouse click will print the X,Y coordinates of the click in hex. It doesn't give you continuous readout, but perhaps it's good enough for your application. With extra work you could even have the coordinates printed to the plot window rather than to the console. See the demo "mousevariables.dem". Ethan > > On Thursday, October 25, 2012 7:57:39 PM UTC-4, sfeam wrote: >> Paul Li wrote: >> >> >> >> > Hi, >> >> > >> >> > I am plotting a set of 2-D points where the Y-coordinates in hex. Is >> > it >> >> > possible to format the current mouse position so that its Y-coordinate >> > is >> >> > displayed in hex as well? >> >> >> >> set mouse format "%x" >> >> or if you want to keep x coordinates in decimal >> >> set mouse format "%g %x" >> >> >> >> But not all terminal types can handle this (for example svg cannot).