On 2017-02-23 12:24-0000 Peter Williams wrote:

> I need to label my contours with floating point values. However, I seem
> to get strange results.
> I have a simplified example of what occurs in the program below. It
> draws an ellipse with contour value 1.0e10, i.e. x*x/4 + y*y = 1.0e10.
> The contour is good. The label is written as 1.0?#???10 where ? stands
> for a character I cannot recognise in this context. What am I doing wrong?

Hi Peter:

As a general rule (for everybody here), check with the examples first to see 
what they do since
those examples are tested thoroughly before each release.

In this case examples/c/x09.c is an example of contour labels which do
work, but I notice the data values do not have the huge scale that
yours do (so our testing never tests the exponential option that is
documented in
<http://plplot.sourceforge.net/docbook-manual/plplot-html-5.12.0/pl_setcontlabelformat.html>).

As a first step, could you let us know your exact platform and also
build example 9 for yourself to confirm it works fine on that
platform?

Assuming that does work, then as a second step to make sure all other
aspects of your own simplified testing example are working properly
what happens if you scale your example, (e.g., set the above 1.0e10
value to something like 1.0) to a non-exponential range, and use
pl_setcontlabelformat( 4, 3 ); like example 9 does?  If that also
works (as it should if example 9 works for you), then I would scale
your example to both single-digit positive and negative exponents, and
also explore what happens if you change the parameters of
pl_setcontlabelformat.  That is, explore the problem a little to give
us an idea of the conditions (compared to the scale of our example 9)
where you are getting bad labels.

I have just taken a quick look at the contour labelling code in
src/plcont.c (which we haven't looked at in years), and its
self-documentation says it should be able to handle the case of
positive exponents with 4 digits or negative exponents with 3 digits
but your results indicate there might be some bug there so your
explorations of the problem may help us to find that bug assuming it
exists.

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
__________________________

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to