#4529: Implement plots with logarithmic scale
-----------------------------------------+----------------------------------
       Reporter:  ronanpaixao            |         Owner:  ronanpaixao          
           Type:  enhancement            |        Status:  needs_work           
       Priority:  major                  |     Milestone:  sage-5.1             
      Component:  graphics               |    Resolution:                       
       Keywords:  plot log scale         |   Work issues:  convenience functions
Report Upstream:  N/A                    |     Reviewers:  Karl-Dieter Crisman  
        Authors:  Punarbasu Purkayastha  |     Merged in:                       
   Dependencies:  #12974                 |      Stopgaps:                       
-----------------------------------------+----------------------------------

Comment (by ppurka):

 Replying to [comment:39 kcrisman]:
 > Some comments:
 >  * Shouldn't `base=2` raise an error when `scale='linear'` in your
 example? Maybe the
 > {{{
 >        if scale is None:
 >             return ('linear', 'linear', 10, 10)
 > }}}
 >    could return 'linear', 'linear', None, None?

 I had thought about it. My decision was to silently ignore this error
 because it is not fatal in any way and we handle it properly (i.e. we
 ignore it and do the right thing).

 >  * In `_matplotlib_tick_formatter`, should `base` and `scale` be next to
 each other in the function definition?  (This is a very minor critique, of
 course.)

 Well, except for `subplot`, the rest of the arguments are alphabetically
 arranged. :) Personally, I find it quite hard to find out where a
 particular function or argument is present in a typical Sage code. There
 is no particular manner in which the functions are arranged. Especially in
 several thousand line files like graphics.py it becomes hard to scroll
 around and edit code.

 >  * Regardless of the outcome of the poll (on which you can vote), I
 think one should add a lot more examples in the documentation for `show`
 for the various options.  Lots of them.

 I will add some more.

 >  * What's going on with the `pr, i  = '', 0` thing removed?  I just
 don't know what it had been doing - seems to have been dead code, but I
 always get nervous when I have no idea what it ''used'' to do...

 Yes. I have no idea what it was for. It is dead code, so I removed it.

 >  * kini says that the `[13:]` seems brittle if matplotlib's API changes;
 would it be possible to remove the specific string `\\mathdefault`
 instead?

 To remove it from matplotlib, we need to set rcParams['text.usetex']=True.
 But this makes matplotlib try to compile latex on its own and use dvipng
 to convert from dvi to png, etc. Moreover, this parameter seems to be
 persistent and remains throughout the current session. So, simply editing
 the string seemed a more viable option to me.

 If the API changes (which seems unlikely to me), then the fix will be very
 easy too.

 >  * I wonder about the not setting of the spines outward when the axes
 shouldn't cross.  Here is an example which serves the point:
 > {{{
 > sage: G = plot(exp(x), (x,5,10))
 > sage: G.show(scale=('semilogy', 2))
 > }}}
 >    I don't even think this is a very atypical example to arise in
 practice.  It should be documented somehow.

 I will have to see how to handle this. Messing around with the spines was
 one of the primary reasons why setting scale wasn't working - the
 "converting masked to int" error.

 >  * It's fairly easy to have just one tick in a given direction, which
 usually raises an error in normal plots but isn't raising an error for
 yours.  I'm not sure if one would want to raise an error like "Use a
 different base so that you get at least two ticks!" or something.

 I think it is up to the user to either change their range, or their base,
 or provide custom ticks.

 > But even with all of these comments, and waiting for the post-poll
 patch, '''fantastic''' job on this.  Someone had to come along to finally
 wrap this for us, it's been requested zillions of times, and this is very
 worth the effort, thank you so much.

 Thanks. I needed it for my own research! :)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4529#comment:40>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to