wiki

Well, I come from the United States, where we basically ignore international standards and let the rest of the world do what it wants. Except when it annoys us.

However, there is something called an internationalization which tells clever programmers who use it what to use as a digits separator and what to use as a decimal point. Support for I18N is built into most operating systems. Unfortunately, I don' t know the Python API. Does anybody?

···

On Dec 18, 2006, at 10:35 AM, John Travers wrote:

On 18/12/06, Simson Garfinkel <simsong@...1340...> wrote:

It really depends on your audience as to whether or not 1,000,000
through 9,000,000 is better displayed in scientific notation or not.
For audiences that I frequently present to, any scientific notation
is just unacceptable. You can add quantifiers (like KBps, MBps,
GBps), but presenting something a 5e+5 Bps will just be lost. You
*might* get away with e+3, e+6, and e+9, but never the other e's.

Where I come from (Europe) 9,000,000 means 9.0 and 9.000.000 means
what you mean. That is why there is an international standard of
having 9 000 000. Basically these things should be tunable through
simple rc options.
As to the point that different rc options can produce different
results on different machines, as far as I am aware, all options can
be overridden in the script itself (correct me if I am wrong?).

Best regards,
John

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I wonder: how hard would it be to add some intelligence to the interpreter and/or exception handler such that if the manner of (mis)use of one of these implied that what the programmer meant was the other, then the error message would say something like "Perhaps you meant to use axis (or axes, as appropriate) here?"

DG

belinda thom wrote:

···

On Dec 16, 2006, at 8:10 PM, John Hunter wrote:

    > 3. If I was going to make a major change to the API at
    > this point, it would be to make it so that you don't have
    > a class/function/ identifier called "axes" and another one
    > called "axis." I frequently get confused between these two
    > words; I imagine that non-native English speakers get
    > confused even more frequently. Irregular noun plurals in
    > English are confusing, and it probably isn't necessary to
    > use both. One approach would be to never allow "axis," to
    > only allow "xaxis" and "yaxis" and perhaps something
    > (either_axis?) for the abstract super-class, but this may
    > be a bigger change than you wish to consider at the
    > present time.

Yes, this is a confusing and poor nomenclature. We're probably stuck
with it at this point, since it fairly deeply ingrained.
    
The axis/axes function names are Matlab relics, so to have used something else would probably have caused other complaints.

On the bright side, at least w/matplotlib, you're not paying out the wazoo :slight_smile: for such things.

--b

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>

Simson Garfinkel wrote:

It really depends on your audience as to whether or not 1,000,000 through 9,000,000 is better displayed in scientific notation or not. For audiences that I frequently present to, any scientific notation is just unacceptable. You can add quantifiers (like KBps, MBps, GBps), but presenting something a 5e+5 Bps will just be lost. You *might* get away with e+3, e+6, and e+9, but never the other e's.
  

Ah, "Engineering" notation - that could be a useful helper function.

DG

···

On Dec 18, 2006, at 8:53 AM, Darren Dale wrote:

On Saturday 16 December 2006 20:00, Simson Garfinkel wrote:
    

1. I think that scientific notation should not be the default, unless
numbers exceed 1E+7.
      

There are good reasons to use scientific notation for smaller numbers than
10e+-7: We dont want neighboring tick labels to run into each other on the x
axis, and we dont tick labels to run out of the window on the y axis. For
examples, see the attachments at the bottom of this page:
http://sourceforge.net/tracker/index.php? func=detail&aid=1196027&group_id=80706&atid=560720

Darren

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>

Simson Garfinkel wrote:

Well, I come from the United States, where we basically ignore international standards and let the rest of the world do what it wants. Except when it annoys us.
  

Insert wink or smiley face here to signify irony, yes?

···

However, there is something called an internationalization which tells clever programmers who use it what to use as a digits separator and what to use as a decimal point. Support for I18N is built into most operating systems. Unfortunately, I don' t know the Python API. Does anybody?

On Dec 18, 2006, at 10:35 AM, John Travers wrote:

On 18/12/06, Simson Garfinkel <simsong@...1340...> wrote:
    

It really depends on your audience as to whether or not 1,000,000
through 9,000,000 is better displayed in scientific notation or not.
For audiences that I frequently present to, any scientific notation
is just unacceptable. You can add quantifiers (like KBps, MBps,
GBps), but presenting something a 5e+5 Bps will just be lost. You
*might* get away with e+3, e+6, and e+9, but never the other e's.
      

Where I come from (Europe) 9,000,000 means 9.0 and 9.000.000 means
what you mean. That is why there is an international standard of
having 9 000 000. Basically these things should be tunable through
simple rc options.
As to the point that different rc options can produce different
results on different machines, as far as I am aware, all options can
be overridden in the script itself (correct me if I am wrong?).

Best regards,
John

---------------------------------------------------------------------- ---
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php? page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>

A few months ago the question got asked on this very list.
The idea is to define a specific formatter. Here's what I'd come with (I copy
the initial post for convenience at the end of the message).

If it's found useful, I could put it in the cookbook (now that I remember how
to edit the wiki). Or I could leave our dear developers add it to the core.

P.

···

On Monday 18 December 2006 13:29, David L Goldsmith wrote:

Simson Garfinkel wrote:
> It really depends on your audience as to whether or not 1,000,000
> through 9,000,000 is better displayed in scientific notation or not.
> For audiences that I frequently present to, any scientific notation
> is just unacceptable. You can add quantifiers (like KBps, MBps,
> GBps), but presenting something a 5e+5 Bps will just be lost. You
> *might* get away with e+3, e+6, and e+9, but never the other e's.

Ah, "Engineering" notation - that could be a useful helper function.

#----------------------------------------------

class EngrFormatter(ScalarFormatter):
    """A variation of the standard ScalarFormatter, using only multiples of
three
in the mantissa. A fixed number of decimals can be displayed with the optional
parameter `ndec` . If `ndec` is None (default), the number of decimals is
defined
from the current ticks.
    """
    def __init__(self, ndec=None, useOffset=True, useMathText=False):
        ScalarFormatter.__init__(self, useOffset, useMathText)
        if ndec is None or ndec < 0:
            self.format = None
        elif ndec == 0:
            self.format = "%d"
        else:
            self.format = "%%1.%if" % ndec
    #........................
    def _set_orderOfMagnitude(self, mrange):
        """Sets the order of margnitude."""
        locs = N.absolute(self.locs)
        if self.offset:
            oom = math.floor(math.log10(mrange))
        else:
            if locs[0] > locs[-1]:
                val = locs[0]
            else:
                val = locs[-1]
            if val == 0:
                oom = 0
            else:
                oom = math.floor(math.log10(val))
        if oom <= -3:
            self.orderOfMagnitude = 3*(oom//3)
        elif oom <= -1:
            self.orderOfMagnitude = -3
        elif oom >= 4:
            self.orderOfMagnitude = 3*(oom//3)
        else:
            self.orderOfMagnitude = 0
    #........................
    def _set_format(self):
        """Sets the format string to format all ticklabels."""
        # set the format string to format all the ticklabels
        locs = (N.array(self.locs)-self.offset) / 10**self.orderOfMagnitude +
1e-15
        sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \
                   for loc in locs]
        sigfigs.sort()
        if self.format is None:
            self.format = '%1.' + str(sigfigs[-1]) + 'f'
        if self._usetex or self._useMathText:
            self.format = '$%s$' % self.format
#..............................................................................
class MinimalFormatter(Formatter):
    """A minimal formatter: just the plain data !"""
    def __init__(self,sigfigs=None):
        if sigfigs is None:
            self.fmt = "%f"
        else:
            self.fmt = "%.%if" % sigfigs
    def __call__(self,x,pos=None):
        return str(self.fmt % x).rstrip('0')

Pierre,

Offhand, it looks like it should go into ticker.py, so I will probably do that.

Eric

Pierre GM wrote:

···

On Monday 18 December 2006 13:29, David L Goldsmith wrote:

Simson Garfinkel wrote:

It really depends on your audience as to whether or not 1,000,000
through 9,000,000 is better displayed in scientific notation or not.
For audiences that I frequently present to, any scientific notation
is just unacceptable. You can add quantifiers (like KBps, MBps,
GBps), but presenting something a 5e+5 Bps will just be lost. You
*might* get away with e+3, e+6, and e+9, but never the other e's.

Ah, "Engineering" notation - that could be a useful helper function.

A few months ago the question got asked on this very list. The idea is to define a specific formatter. Here's what I'd come with (I copy the initial post for convenience at the end of the message).

If it's found useful, I could put it in the cookbook (now that I remember how to edit the wiki). Or I could leave our dear developers add it to the core.

P.

#----------------------------------------------

class EngrFormatter(ScalarFormatter):
    """A variation of the standard ScalarFormatter, using only multiples of three
in the mantissa. A fixed number of decimals can be displayed with the optional parameter `ndec` . If `ndec` is None (default), the number of decimals is defined
from the current ticks.
    """
    def __init__(self, ndec=None, useOffset=True, useMathText=False):
        ScalarFormatter.__init__(self, useOffset, useMathText)
        if ndec is None or ndec < 0:
            self.format = None
        elif ndec == 0:
            self.format = "%d"
        else:
            self.format = "%%1.%if" % ndec
    #........................
    def _set_orderOfMagnitude(self, mrange):
        """Sets the order of margnitude.""" locs = N.absolute(self.locs)
        if self.offset: oom = math.floor(math.log10(mrange))
        else:
            if locs[0] > locs[-1]: val = locs[0]
            else: val = locs[-1]
            if val == 0: oom = 0
            else: oom = math.floor(math.log10(val))
        if oom <= -3:
            self.orderOfMagnitude = 3*(oom//3)
        elif oom <= -1:
            self.orderOfMagnitude = -3
        elif oom >= 4:
            self.orderOfMagnitude = 3*(oom//3)
        else:
            self.orderOfMagnitude = 0
    #........................
    def _set_format(self):
        """Sets the format string to format all ticklabels."""
        # set the format string to format all the ticklabels
        locs = (N.array(self.locs)-self.offset) / 10**self.orderOfMagnitude + 1e-15
        sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \
                   for loc in locs]
        sigfigs.sort()
        if self.format is None:
            self.format = '%1.' + str(sigfigs[-1]) + 'f'
        if self._usetex or self._useMathText: self.format = '$%s$' % self.format
#..............................................................................
class MinimalFormatter(Formatter):
    """A minimal formatter: just the plain data !"""
    def __init__(self,sigfigs=None):
        if sigfigs is None:
            self.fmt = "%f"
        else:
            self.fmt = "%.%if" % sigfigs
    def __call__(self,x,pos=None):
        return str(self.fmt % x).rstrip('0')

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users