#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 kcrisman):

 So I've come up with a solution.  I'll probably post stuff in a little
 while.  Here's a typical example.
 {{{
 sage: P = plot(x^2,(x,1,8),scale='loglog'); P
 ValueError: Either expand the range of the independent variable to allow
 two different integer powers of your `base`, or change your `base` to a
 smaller number.
 sage: P.show(xmax=10)
 }}}

 Some more food for thought.
 * Your LaTeX hack doesn't work in all cases, apparently.
 {{{
 sage: P = plot(x^2,(x,1,8),scale='loglog', base=1.5); P
 }}}
   This is because matplotlib has
 {{{
         else:
             if usetex:
                 s = r'$%s%d^{%d}$'% (sign_string, b, nearest_long(fx))
             else:
                 s = r'$\mathdefault{%s%d^{%d}}$'% (sign_string, b,
                                                    nearest_long(fx))
 }}}
   which uses decimal formatting, but of course that only makes sense for
 integer bases.   I feel like this is a bug in mpl; what do you think?
 Anyway, I am hesitant to patch our matplotlib just for this use case,
 though it should be a new ticket, I think.  The same thing happens with
 `base=3/2`, unsurprisingly.
 * `base=e` should be possible, but hacking around the fact that matplotlib
 won't accept this maybe makes it not worth it, and in any case I don't
 know that "real-life" people often use that for semilog plots.  Just
 pointing it out.
 * Here is a fun horrible example that you probably were thinking of with
 adding plots - maybe we should find a check for this.
 {{{
 sage: G =
 plot_vector_field((e^x,e^(x+y)),(x,0.1,10),(y,0.1,10),scale=('loglog', 2))
 sage: H = plot(x^2,(x,0,10),scale='linear')
 sage: G+H
 }}}
   At least originally you thought this should raise an error.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4529#comment:48>
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