ó
”¼\c           @  sY   d  d l  m Z m Z d  d l m Z d  d l m Z d  d l m Z d d d  Z	 d S(	   i’’’’(   t   print_functiont   division(   t   Dummy(   t   range(   t   lambdifyi7   i   c         C  sÖ  |  j  } t |  d k r* t d   n  | r< | j   n t   } t | g |   } t |  } t |  } d g | } xb t |  D]T } y* | | | | t |  |  | | <Wq t t f k
 rÜ d | | <q Xq Wt	 |  }	 t
 |  }
 |	 |
 k r9|	 r*t d d |	 g  \ }
 }	 q9d \ }
 }	 n  x> t |  D]0 } t t |  | | |
 |	 |
  | | <qFWd } t xćt | d d d  D]Ė} d g | } xć t |  D]Õ } | | | k r»| d k sõ| | d | d k r*| | d k s| | d | d k r*d | | <q| d k sN| | d | d k r| | d k sv| | d | d k rd	 | | <qd
 | | <q»q»W| | d k r¾d |	 j |  |  } nb | | d k ršd |
 |	 d j |  |  } n0 | d k rd |
 j |  |  } n
 d | } d j |  } | | d k rT| j d d  } n  t | d |  qWd | d } | d | j | d d  7} | d | | d j | d  7} | d | 7} t |  d S(   sā   
    Print a crude ASCII art plot of the SymPy expression 'expr' (which
    should contain a single symbol, e.g. x or something else) over the
    interval [a, b].

    Examples
    ========

    textplot(sin(t)*t, 0, 15)
    i   s    length can not be greater than 1i    i   i’’’’i   t    t   /s   \t   .s   %gt    t   -s    | i   i   N(   i’’’’i   (   t   free_symbolst   lent
   ValueErrort   popR   R   t   floatR   t	   TypeErrort   maxt   mint   sortedt   intt   printt   rjustt   joint   replacet   ljust(   t   exprt   at   bt   Wt   Ht   freet   xt   ft   yt   mat   mit   margint   ht   st   prefixt   bottom(    (    s6   lib/python2.7/site-packages/sympy/plotting/textplot.pyt   textplot   s`    	*.LL"
#N(
   t
   __future__R    R   t   sympy.core.symbolR   t   sympy.core.compatibilityR   t   sympy.utilities.lambdifyR   R)   (    (    (    s6   lib/python2.7/site-packages/sympy/plotting/textplot.pyt   <module>   s   