Several of the routines in src/plbox.c had snprintf calls similar
to the following:

snprintf( string, STRING_LEN, "(x10#u%d#d)", (int) scale );

That, of course, was wrong since it assumed the current PLplot string escape
character was always going to be '#' (which is usually the case, but not
always the case).  Before the fix you could demonstrate the problem by
inserting  "plsesc('@');" in C example 1 and watch how that screwed
up the exponent on one of the axes.

I have fixed these issues (revision 12705) by writing a static
function called plgesc_string which returns the string (not integer)
associated with the current escape character, and I use that string to
replace the "#" characters that appear in the above and similar
statements.  Those changes fixed the slightly modified example 1 that
I used to demonstrate the original issue.

As the years go by, I have gained more confidence in my C skills, but
nevertheless the implementation of plgesc_string is pretty brute
force; it uses 9 case statements (similar to those used in plsesc to
filter attempts to set anything other than the 9 escape character
possibilities we allow) to sort out the possibilities. So if anybody
here can think of a faster, more elegant way to do this, please let me
know.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to