Changeset 4318:9749e933ad06


Ignore:
Timestamp:
05/05/07 13:32:46 (6 years ago)
Author:
William Stein <wstein@…>
Branch:
default
Message:

Enable show_default function for plotting; also fix some docs as suggested by Brian Harris.

Location:
sage/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sage/plot/all.py

    r3581 r4318  
    44                  polar_plot, contour_plot, arrow, 
    55                  plot_vector_field, matrix_plot, bar_chart, 
    6                   is_Graphics) 
     6                  is_Graphics, 
     7                  show_default) 
    78 
    89from plot3d import (Graphics3d, point3d, line3d) 
  • sage/plot/plot.py

    r4308 r4318  
    141141EMBEDDED_MODE = False 
    142142SHOW_DEFAULT = False 
     143 
     144def show_default(default=None): 
     145    """ 
     146    Set the default for showing plots using the following commands: 
     147        plot, parametric_plot, polar_plot, and list_plot. 
     148 
     149    If called with no arguments, returns the current default. 
     150 
     151    EXAMPLES: 
     152    The default starts out as False: 
     153        sage: show_default() 
     154        False 
     155 
     156    We set it to True.   
     157        sage: show_default(True) 
     158 
     159    We see that it is True. 
     160        sage: show_default() 
     161        True 
     162 
     163    Now certain plot commands will display their plots by default. 
     164 
     165    Turn of default display. 
     166        sage: show_default(False) 
     167 
     168    """ 
     169    global SHOW_DEFAULT 
     170    if default is None: 
     171        return SHOW_DEFAULT 
     172    SHOW_DEFAULT = bool(default) 
    143173 
    144174do_verify = True 
     
    24332463        tmin -- start value of t 
    24342464        tmax -- end value of t 
    2435         show -- whether or not to show the plot immediately (default: True) 
     2465        show -- bool or None 
     2466                (default: use the default as set by the show_default command) 
     2467                 whether or not to show the plot immediately 
    24362468        other options -- passed to plot. 
    24372469 
Note: See TracChangeset for help on using the changeset viewer.