
t,2Jc        )   @   s  d  Z  d d k l Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d   Z	 y d d k
 l Z Wn# e j
 o d d k l Z n Xd d k l Z d d k l Z d d k l Z l Z l Z d d	 k l Z d d
 k l Z d d k l Z l Z l Z l Z d d k l Z l  Z  l! Z! l" Z" d d k# l$ Z$ d d k% l& Z& d d k' l( Z( l) Z) d d k* l+ Z+ l, Z, l- Z- d d k. l/ Z/ d d k0 l1 Z1 d d k2 l3 Z3 d d k4 l5 Z5 d d k6 l7 Z7 d d k8 l9 Z9 d d k: Z; d d k< Z< d d k= Z= y e> Wn# e? j
 o d d k@ lA Z> n Xe iB iC d  o
 d ZD n d ZD d ZE d ZF h d d f d 6d d  f d! 6d d" f d# 6d$ d% f d& 6d' d$ f d( 6d) d' f d* 6d+ d) f d, 6d- d+ f d. 6d/ d- f d0 6d1 d/ f d2 6d3 d1 f d4 6d5 d3 f d6 6d7 d8 f d9 6d: d7 f d; 6d< d= f d> 6d? d< f d@ 6dA d? f dB 6dC dA f dD 6dE dC f dF 6dG dE f dH 6dI dG f dJ 6dK dI f dL 6dM dK f dN 6dO dM f dP 6dQ dO f dR 6ZG dS   ZH dT   ZI dU   ZJ dV   ZK dW   ZL dX e f dY     YZM dZ e f d[     YZN d\   ZO d] e f d^     YZP d_   ZQ eR d eS d`  ZT eR d eS da  ZU db   ZV dc   ZW dd e f de     YZX eX ZY df dg dh di dj dk dl g ZZ d S(m   sF   
A PostScript backend, which can produce both PostScript .ps and .eps
i(   t   divisionNc           C   s   t  i d  i i S(   Ni   (   t   syst	   _getframet   f_codet   co_name(    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _fn_name   s    (   t   md5(   t   mkstemp(   t   StringIO(   t   verboset   __version__t   rcParams(   t   Gcf(   t   AFM(   t   RendererBaset   GraphicsContextBaset   FigureManagerBaset   FigureCanvasBase(   t   is_string_liket   get_realpath_and_statt   is_writable_file_liket   maxdict(   t
   quad2cubic(   t   Figure(   t   findfontt   is_opentype_cff_font(   t   FT2Fontt   KERNING_DEFAULTt   LOAD_NO_HINTING(   t   convert_ttf_to_ps(   t   MathTextParser(   t	   uni2type1(   t   Text(   t   Path(   t   IdentityTransform(   t   Sett   wint   &t   ;s   Level IIi    g      !@i   t   letteri   t   legali   t   ledgergGz@@gHzgG@t   a0gp=
c7@t   a1g
ףp=0@t   a2gzGa'@t   a3g
ףp= @t   a4gRQ@t   a5gQ@t   a6gHzG@t   a7g(\ @t   a8gZd;O?gffffff @t   a9gRQ?t   a10gfffffFD@g)\L@t   b0g)\<@t   b1gQE4@t   b2g)\,@t   b3gQ8$@t   b4gp=
ף@t   b5g)\(@t   b6gp=
ף@t   b7gGz@t   b8g)\(?t   b9g)\(?t   b10c         C   s   t  i   } | i   | i   xX | D]L } | i d  o q' n t  | \ } } |  | j  o | | j  o | Sq' Wd Sd  S(   Nt   lR*   (   t	   papersizet   keyst   sortt   reverset
   startswith(   t   wt   hRB   t   keyt   pwt   ph(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _get_papertypeM   s    

   	c         C   sb   t  |   o |  St |   } |  | j o t |  Sd |  } | i d  } | i d  } | S(   Ns   %1.3ft   0t   .(   R   t   intt   strt   rstrip(   t   valt   ivalt   s(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _num_to_strX   s      
c          G   s   d i  t t |    S(   Nt    (   t   joint   mapRT   (   t   args(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _nums_to_strc   s    c         C   sv   |  i  d d  }  |  i  d d  }  |  i  d d  }  |  i  d d  }  |  i  d	 d
  }  t i d d   |   }  |  S(   sH   Quote dangerous characters of S for use in a PostScript string constant.s   \s   \\t   (s   \(t   )s   \)t   's   \251t   `s   \301s   [^ -~\n]c         S   s   d  t  |  i    S(   s   \%03o(   t   ordt   group(   t   x(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   <lambda>m   s    (   t   replacet   ret   sub(   RS   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   quote_ps_stringf   s    c         C   sa   |  d j o | d j S| d j o t St |   t |  j o t St i t i |  |   S(   s   
    seq1 and seq2 are either None or sequences or numerix arrays
    Return True if both are None or both are seqs with identical
    elements
    N(   t   Nonet   Falset   lent   npyt   alltruet   equal(   t   seq1t   seq2(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   seq_allequalq   s     t
   RendererPSc           B   s  e  Z d  Z e d  Z e d  Z d d  Z d   Z d   Z d d  Z	 d d  Z
 d d	  Z d d
  Z d d  Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d d d  Z d d  Z d   Z d) d) d  Z d) d  Z d   Z d) d  Z d) d   Z d!   Z  d" d#  Z! d$   Z" d%   Z# d&   Z$ d'   Z% e& e& d) d(  Z' RS(*   s   
    The renderer handles all the drawing primitives using a graphics
    context instance that controls the colors/styles.
    i2   iH   c         C   s  t  i |   | |  _ | |  _ | |  _ t d o d |  _ g  |  _ n | |  _ t d o | | | | f |  _	 n
 d |  _	 d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ | d |  _ h  |  _ d |  _ h  |  _ t d  |  _ d S(   s   
        Although postscript itself is dpi independent, we need to
        imform the image code about a requested dpi to generate high
        res images and them scale them before embeddin them
        s   text.usetexi    s   path.simplifyg      R@t   PSN(   R   t   __init__t   widtht   heightt	   _pswriterR   t   textcntt   psfragt   imagedpit   simplifyRf   t   colort	   linewidtht   linejoint   linecapt   linedasht   fontnamet   fontsizet   hatcht   image_magnificationt   _clip_pathst   _path_collection_idt   used_charactersR   t   mathtext_parser(   t   selfRr   Rs   t   pswriterRw   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRq      s0    																	c         C   si   t  | i  \ } } |  i i | | t   f  } | d i g  } | D] } | t |  qH ~  d S(   sD   Keeps track of which characters are required from
        each font.i   N(   R   t   fnameR   t
   setdefaultt   sett   updateR^   (   R   t   fontRS   t   realpatht   stat_keyR   t   _[1]R`   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   track_characters   s    	c         C   sV   xO | i    D]A \ } \ } } |  i i | | t   f  } | d i |  q Wd  S(   Ni   (   t   itemsR   R   R   R   (   R   t   otherR   R   t   charsetR   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   merge_used_characters   s
     	i   c         C   s   | | | f |  i  j op | | j o% | | j o |  i i d |  n |  i i d | | | f  | o | | | f |  _  q n d  S(   Ns   %1.3f setgray
s   %1.3f %1.3f %1.3f setrgbcolor
(   Ry   Rt   t   write(   R   t   rt   gt   bt   store(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt	   set_color   s     c         C   s@   | |  i  j o, |  i i d |  | o | |  _  q< n d  S(   Ns   %1.3f setlinewidth
(   Rz   Rt   R   (   R   Rz   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   set_linewidth   s     c         C   s@   | |  i  j o, |  i i d |  | o | |  _  q< n d  S(   Ns   %d setlinejoin
(   R{   Rt   R   (   R   R{   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   set_linejoin   s     c         C   s@   | |  i  j o, |  i i d |  | o | |  _  q< n d  S(   Ns   %d setlinecap
(   R|   Rt   R   (   R   R|   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   set_linecap   s     c         C   s   |  i  d  j	 o( |  i  \ } } t | |  o d  Sn | d  j	 o7 t |  o* d t |   | f } |  i i |  n |  i i d  | o | | f |  _  n d  S(   Ns   [%s] %d setdash
s   [] 0 setdash
(   R}   Rf   Rn   Rh   RY   Rt   R   (   R   t   offsett   seqR   t   oldot   oldseqRS   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   set_linedash   s     	 c         C   s   t  d o d  S| | f |  i |  i f j oL d | | f } |  i i |  | o | |  _ n | o | |  _ q{ n d  S(   Ns	   ps.useafms%   /%s findfont
%1.3f scalefont
setfont
(   R   R~   R   Rt   R   (   R   R~   R   R   t   out(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   set_font   s       c         C   s  h d d 6d d 6d d 6d d 6} x | D] } | d j o | d c d 7<q) | d j o | d c d 7<q) | d	 j o | d c d 7<q) | d
 j o | d c d 7<q) | d j o$ | d c d 7<| d c d 7<q) | i    d j o$ | d c d 7<| d c d 7<q) q) Wd   } |  i i d  |  i i | d | d   |  i i | d | d   |  i i | d | d   |  i i | d | d   |  i i d  d S(   s  
        hatch can be one of:
            /   - diagonal hatching
            \   - back diagonal
            |   - vertical
            -   - horizontal
            +   - crossed
            X   - crossed diagonal

        letters can be combined, in which case all the specified
        hatchings are done

        if same letter repeats, it increases the density of hatching
        in that direction
        i    t   horizt   vertt   diag1t   diag2t   /i   s   \t   |t   -t   +R`   c         S   s$   | d j o d Sd |  d | f S(   Ni    t    sK    gsave
   eoclip %s rotate 0.0 0.0 0.0 0.0 setrgbcolor 0 setlinewidth
   /hatchgap %d def
   pathbbox /hatchb exch def /hatchr exch def /hatcht exch def /hatchl exch def
   hatchl cvi hatchgap idiv hatchgap mul
   hatchgap
   hatchr cvi hatchgap idiv hatchgap mul
   {hatcht m 0 hatchb hatcht sub r }
   for
   stroke
  grestore
 i   (    (   t   anglet   density(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   do_hatch  s     s   gsave
iZ   i-   is	   grestore
N(   t   lowerRt   R   (   R   R   t   hatchesR'   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt	   set_hatch   s0    "     	c         C   s   |  i  |  i f S(   s4   return the canvas width and height in display coords(   Rr   Rs   (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   get_canvas_width_height  s    c         C   s  t  d oX |  i   } | i   } | i | |  \ } } } }	 | | }
 |	 | } |
 | d f S| o5 |  i i | d |  \ } } } } } | | | f St  d o | o | d d !} n |  i |  } | i |  \ } } }
 } } | i   } d | } |
 | 9}
 | | 9} | | 9} |
 | | f S|  i |  } | i	 | d d	 t
 | i   \ }
 } |
 d
 }
 | d
 } | i   } | d
 } |
 | | f S(   sm   
        get the width and height in display coords of the string s
        with FontPropertry prop

        s   text.usetexi    iH   s	   ps.useafmi   igMbP?g        t   flagsg      P@(   R   t   get_texmanagert   get_size_in_pointst   get_ps_bboxR   t   parset   _get_font_afmt   get_str_bbox_and_descentt   _get_font_ttft   set_textR   t   get_width_heightt   get_descent(   R   RS   t   propt   ismatht
   texmanagerR   R@   R   R   t   tRF   RG   Rr   Rs   t   descentR   R   R   t   dt   scale(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   get_text_width_height_descent"  s:    

' 






c         C   s   t  S(   s3   return true if small y numbers are top for renderer(   Rg   (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   flipyM  s    c         C   s   t  |  } |  i i |  } | d  j oq t | d d } |  i i |  } | d  j o/ t t t | d d   } | |  i | <n | |  i | <n | S(   Nt   fontextt   afm(   t   hasht   afmfontdt   getRf   R   R   t   file(   R   R   RH   R   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR   Q  s    c         C   s   t  |  } |  i i |  } | d  j o_ t |  } |  i i |  } | d  j o# t t |   } | |  i | <n | |  i | <n | i   | i   } | i	 | d  | S(   Ng      R@(
   R   t   fontdR   Rf   R   R   RO   t   clearR   t   set_size(   R   R   RH   R   R   t   size(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR   ]  s    
c         C   s
   | i    S(   N(   t   as_rgba_str(   R   t   im(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _rgbal  s    c         C   st   | i    \ } } } t i | t i  } | | d f | _ | d  d   d  d   d  d  f } | | | i   f S(   Ni   i   (   R   Ri   t
   fromstringt   uint8t   shapet   tostring(   R   R   RG   RF   RS   t   rgbat   rgb(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _rgbo  s
    %g333333?gzG?g)\(?c         C   s   | i    } t i | d t i  } | d | d d f | _ | i t i  } | d  d   d  d   d f } | d  d   d  d   d f }	 | d  d   d  d   d f }
 | | |	 | |
 | i t i  } | d | d | i   f S(   Ni   i    i   i   (   R   Ri   R   R   R   t   astypet   float32R   (   R   R   t   rct   gct   bct   rgbatR   t   rgba_fR   R   R   t   gray(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _grayw  s    &i   c         C   si   t  i |  } t |  } g  } xA t d | |  D]- } t | | |  } | i | | | ! q4 W| S(   Ni    (   t   binasciit   b2a_hexRh   t   ranget   mint   append(   R   RS   t   chars_per_linet   nhext   linest   it   limit(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt
   _hex_lines  s     c         C   s   |  i  S(   s   
        Get the factor by which to magnify images passed to draw_image.
        Allows a backend to have images at a different resolution to other
        artists.
        (   R   (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   get_image_magnification  s    c         C   sN  | i    | i o" |  i |  \ } } }	 d }
 n |  i |  \ } } }	 d }
 d i |  i |	   } | |  i | |  i } } |  i d } g  } | d j	 o9 | i	 \ } } } } | i
 d t | | | |   n | d j	 o' |  i | |  } | i
 d |  n d i |  } d t   } |  i i |  | i    d S(	   s	  
        Draw the Image instance into the current axes; x is the
        distance in pixels from the left hand side of the canvas and y
        is the distance from bottom

        bbox is a matplotlib.transforms.BBox instance for clipping, or
        None
        t   images   false 3 colorimages   
iH   s
   %s clipboxs   %ss   gsave
%(clip)s
%(x)s %(y)s translate
%(xscale)s %(yscale)s scale
/DataString %(w)s string def
%(w)s %(h)s 8 [ %(w)s 0 0 -%(h)s 0 %(h)s ]
{
currentfile DataString readhexstring pop
} bind %(imagecmd)s
%(hexlines)s
grestore
N(   t
   flipud_outt   is_grayscaleR   R   RV   R   R   Rs   Rf   t   boundsR   RY   t   _get_clip_patht   localsRt   R   (   R   R`   t   yR   t   bboxt   clippatht   clippath_transRG   RF   t   bitst   imagecmdt   hexlinest   xscalet   yscalet   fight   clipt   clipxt   clipyt   clipwt   clipht   idt   ps(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt
   draw_image  s(    



$c         C   sE  | i  |  } g  } d  } x| i |  D]\ } } | t i j o | i d t |   n | t i j o | i d t |   n | t i j o? t	 t
 | d  t
 |    } | i d t | d   nM | t i j o | i d t |   n" | t i j o | i d  n | } q+ Wd i |  } | S(   Ns   %g %g ms   %g %g lis   %g %g %g %g %g %g ci   t   cls   
(   t   transform_pathRf   t   iter_segmentsR!   t   MOVETOR   t   tuplet   LINETOt   CURVE3R   t   listt   CURVE4t	   CLOSEPOLYRV   (   R   t   patht	   transformRx   R  t   last_pointst   pointst   code(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   _convert_path  s(      	
c         C   s   |  i  i | | f  } | d  j o d t |  i   } d | g } | i |  i | |   | i d d d g  |  i i d i	 |   | |  i  | | f <n | S(   Ns   c%xs   /%s {R  t   newpaths   } bind def
s   
(
   R   R   Rf   Rh   R   R  t   extendRt   R   RV   (   R   R   t   clippath_transformR  t   ps_cmd(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR     s    c         C   s/   |  i  | | |  i  } |  i | | |  d S(   sI   
        Draws a Path instance using the given affine transform.
        N(   R  Rx   t   _draw_ps(   R   R   R  R  t   rgbFaceR  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt	   draw_path  s    c      
   C   ss  t  o |  i i d  n |  i i } | oJ | d | d j o' | d | d j o d | d } qx d | } n d d d	 d
 g }	 |	 i |  i | |   | o |	 i d | d d g  n |	 i d d d g  | i |  }
 xR |
 i   D]D \ } } t |  o+ | d \ } } |	 i d | | f  q q Wd i	 |	  } |  i
 | | | d t d t d S(   s   
        Draw the markers defined by path at each of the positions in x
        and y.  path coordinates are points, x and y coords will be
        transformed by the transform
        s   % draw_markers 
i    i   i   s   %1.3f setgrays   %1.3f %1.3f %1.3f setrgbcolors   /o {t   gsaveR  t	   translatet   fillt   grestoret   strokes
   } bind defis   %g %g os   
N(   t   debugPSRt   R   R   R  R  R  R  Rh   RV   R  Rg   (   R   R   t   marker_patht   marker_transR  t   transR  R   t   ps_colorR  t   tpatht   verticesR  R`   R   R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   draw_markers  s(     * c         C   s6  |  i  i } g  } x t |  i | | |   D] \ } \ } } d |  i | f } d | d d g } | i |  i | |   | i d g  | d i |   | i |  q. Wxm |  i	 | | | | | | |	 |
 | | | |  D]; \ } } } } } d | | | f } |  i
 | | |  q W|  i d 7_ d  S(	   Ns   p%x_%xs   /%s {R  R"  s   } bind def
s   
s   %g %g %si   (   Rt   R   t	   enumeratet   _iter_collection_raw_pathsR   R   R  R  RV   t   _iter_collectionR  (   R   t   master_transformt   cliprectR   R   t   pathst   all_transformst   offsetst   offsetTranst
   facecolorst
   edgecolorst
   linewidthst
   linestylest   antialiasedst   urlsR   t
   path_codesR   R  R  t   nameR  t   xot   yot   path_idR   R  R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   draw_path_collection  s(     	 s   TeX!c         C   s   |  i  | | |  \ } }	 }
 | i   } d } t | | |  } d |  i } d | i   d  } h d d 6d d 6i t d	 d
  } | | } d | | f } |  i i d | | | | d | f  d t	   } |  i
 i |  |  i d 7_ d S(   s&   
        draw a Text instance
        i    s
   psmarker%ds   %1.3f,%1.3f,%1.3fi   s   {\sffamily %s}s
   sans-serifs   {\ttfamily %s}t	   monospaces   font.familys   {\rmfamily %s}s   \color[rgb]{%s} %ss/   \psfrag{%s}[bl][bl][1][%f]{\fontsize{%f}{%f}%s}g      ?s5   gsave
%(pos)s moveto
(%(thetext)s)
show
grestore
    i   N(   R   R   RY   Ru   t   get_rgbR   R   Rv   R   R   Rt   R   (   R   R   R`   R   RS   R   R   R   RF   RG   t   blR   t   corrt   post   thetextRy   t   fontcmdt   texR  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   draw_tex.  s    


'c         C   s  |  i  i } t o | d  n | d j o |  i | | | | | |  S| o |  i | | | | | |  St | t  o |  i | | | | | |  St d o|  i	 |  }	 |	 i
 |  \ }
 } } } | i   } |
 d | 9}
 | d | 9} | d | 9} | d | 9} | d j o | |
 }
 } n t | |
 | |  } d | } |	 i   } | i   } d | } d | i   d	  } d
 t   } |  i | | d  n|  i |  }	 |	 i | d d t |  i |	 |  |  i | i     |  i |	 i   d | i    | d t | |   | o" | d  | d t |   n |	 i   d } | o | d t |   n | d t |   | o | d  n d S(   s&   
        draw a Text instance
        s   % text
t   TeXs	   ps.useafmgMbP?iZ   s   (%s)s   %1.1f rotates   %1.3f %1.3f %1.3f setrgbcolori   s   gsave
/%(fontname)s findfont
%(fontsize)s scalefont
setfont
%(pos)s moveto
%(rotate)s
%(thetext)s
%(setcolor)s
show
grestore
    i    R   i   i   s   %s m
s   gsave
s
   %s rotate
g      P@s   0 %s rmoveto
s
   (%s) show
s	   grestore
N(   i   i    i    i   (   Rt   R   R&  RJ  t   draw_mathtextt
   isinstancet   unicodet   draw_unicodeR   R   t   get_str_bboxR   RY   t   get_fontnameRD  R   R  Rf   R   R   R   R   R   R   t   get_sfntRT   R   Re   (   R   R   R`   R   RS   R   R   R   R   R   R@   R   RF   RG   R   RG  RH  R~   t   rotatet   setcolorR  R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt	   draw_textI  sT     

 
c         C   s   t    S(   N(   t   GraphicsContextPS(   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   new_gc  s    c      	   C   s  t  d oi|  i | i     |  i |  } | i   } | i   }	 d |	 }
 d } | i |  d |
 } d } g  } x | D] } t i	 t
 |  d  } y | i |  } Wn( t j
 o d } | i d  } n X| d j	 o | i | |  } n d } | } | | |
 7} | i d | | | f  | | |
 7} q Wd i |  } d	 t   } |  i i |  n|  i |  } | i | d d
 t |  i | |  |  i | i     |  i | i   d | i    | i   } d } g  } d } | i   d } x | D] } t
 |  } | i	 |  } | d j o t
 d  } d } d } n | i |  } | i | d
 t } | d j	 o | i | | t  } n d } | } | | d 7} | i d | | | f  | | i  d 7} qWd i |  } d t   } |  i i |  d S(   sl   draw a unicode string.  ps doesn't have unicode support, so
        we have to do this the hard way
        s	   ps.useafmgMbP?i    i   t   questiont   ?s   %f %f m /%s glyphshows   
s|   gsave
/%(fontname)s findfont
%(fontsize)s scalefont
setfont
%(x)f %(y)f translate
%(angle)f rotate
%(thetext)s
grestore
    R   i   i   g      P@s   .notdefg      @sB   gsave
%(x)f %(y)f translate
%(angle)f rotate
%(thetext)s
grestore
N(   i   i    i    i   (!   R   R   RD  R   RR  R   R   Rf   R   R   R^   t   get_width_from_char_namet   KeyErrort   get_width_chart   get_kern_dist_from_nameR   RV   R   Rt   R   R   R   R   R   R   RS  t   get_charmapR   t   get_glyph_namet	   load_chart   get_kerningR   t   linearHoriAdvance(   R   R   R`   R   RS   R   R   R   R~   R   R   t   thisxt   thisyt	   last_nameR   t   cR>  Rr   t   kernRH  R  t   cmapt   lastgindt   ccodet   gindt   glyph(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRP    st    
 
  
c         C   s   t  o |  i i d  n |  i i | d |  \ } } }	 }
 } |  i |  |  i | i     |
 i   } d t	   } |  i i |  d S(   s>   
        Draw the math text using matplotlib.mathtext
        s   % mathtext
iH   sB   gsave
%(x)f %(y)f translate
%(angle)f rotate
%(thetext)s
grestore
N(
   R&  Rt   R   R   R   R   R   RD  t   getvalueR   (   R   R   R`   R   RS   R   R   Rr   Rs   R   R   R   RH  R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRM    s    'c         C   s  |  i  i } t o | o | d | d  n | i   d j o- t | i    d j p | i   d d j } | o | } | o. | d j	 o! t |  d j p | d d j } | os |  i | i    | i   }	 |  i	 |	  | i
   }
 |  i |
  |  i | i     |  i | i   d    n | d  | i   } | o3 | i \ } } } } | d | | | | f  n | i   \ } } | o$ |  i | |  } | d |  n | | i    | d  | o[ | o/ | d  |  i d d	 | d   | d
  q9|  i d d	 | d   | d  n | i   } | o |  i |  n | o | d  n | d  d S(   sv  
        Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
        applied.  'ps' must consist of PostScript commands to construct a path.

        The fill and/or stroke kwargs can be set to False if the
        'ps' string already includes filling and/or stroking, in
        which case _draw_ps is just supplying properties and
        clipping.
        s   % s   
g        i   s   gsave
s    %1.4g %1.4g %1.4g %1.4g clipbox
s   %s
R   i    s   fill
grestore
s   fill
s   stroke
s	   grestore
N(   Rt   R   R&  t   get_linewidthRh   RD  Rf   R   t   get_joinstyleR   t   get_capstyleR   R   t
   get_dashesR   t   get_clip_rectangleR   t   get_clip_pathR   t   stript	   get_hatchR   (   R   R  R   R  R#  R%  t   commandR   t   mightstroket   jintt   cintR2  R`   R   RF   RG   R   R   R  R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    sP    /#


N((   t   __name__t
   __module__t   __doc__R   R   R   Rq   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   Rf   R	  R  R   R   R-  RB  RK  RV  RX  RP  RM  t   TrueR  (    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRo      sF   #			4		+							5	"		H		\	RW  c           B   s   e  Z d    Z d   Z RS(   c         C   s&   h d d 6d d 6d d 6t  i |   S(   Ni    t   butti   t   roundi   t
   projecting(   R   Rq  (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRq  E  s    
c         C   s&   h d d 6d d 6d d 6t  i |   S(   Ni    t   miteri   R  i   t   bevel(   R   Rp  (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRp  J  s    
(   R{  R|  Rq  Rp  (    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyRW  D  s   	c         O   s@   | i  d t  } | | |   } t |  } t | |   } | S(   Nt   FigureClass(   t   popR   t   FigureCanvasPSt   FigureManagerPS(   t   numRX   t   kwargsR  t   thisFigt   canvast   manager(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   new_figure_managerP  s
    R  c           B   sm   e  Z d    Z h d d 6d d 6Z d   Z d   Z d   Z d   Z d	 d
 d
 d e d d  Z
 d   Z RS(   c         C   s   d  S(   N(    (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   drawX  s    t
   PostscriptR  s   Encapsulated Postscriptt   epsc         C   s   d S(   NR  (    (   R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   get_default_filetype^  s    c         O   s   |  i  | d | |  S(   NR  (   t	   _print_ps(   R   t   outfileRX   R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   print_psa  s    c         O   s   |  i  | d | |  S(   NR  (   R  (   R   R  RX   R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt	   print_epsd  s    c      	   O   sX  | i  d t d  } | i   } | d j o n7 | t j o) t d | d i t i    f   n | i  d d  i   } | d j o
 t } n$ | d j o
 t } n t d	   |  i	 i
 d
  | i  d d
  } | i  d d  }	 | i  d d  }
 t d o& |  i | | | |	 |
 | | |  n# |  i | | | |	 |
 | | |  d  S(   Nt	   papertypes   ps.papersizet   autos>   %s is not a valid papertype. Use one                     of %ss   , t   orientationt   portraitt	   landscapes-   Orientation must be "portrait" or "landscape"iH   t   dpit	   facecolorRF   t	   edgecolors   text.usetex(   R   R   R   RA   t   RuntimeErrorRV   RB   R~  Rg   t   figuret   set_dpit   _print_figure_text   _print_figure(   R   R  t   formatRX   R  R  R  t   isLandscapeRw   R  R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR  g  s,    & 
 
iH   RF   R  c	   ,      C   sJ  | d j }	 t  }
 t   \ } } t |  o
 | } n* t |  o d) } t }
 n t d   t i |  t	 | d  } |  i
 i   \ } } | d j o- | o t | |  } q t | |  } n | o t | \ } } n t | \ } } t d oy | d j ok | | j p | | j oM | o# t | |  } t | \ } } qwt | |  } t | \ } } q{n d* | | } d+ | | } |  i
 i i \ } } } } | } | } | | } | | } d } | o= | | | | f \ } } } } d | | | } } d	 } n | | | | f } |  i
 i   } |  i
 i   }  |  i
 i |  |  i
 i |  t   |  _ t | | |  i d
 | }! |  i
 i |!  |  i
 i |  |  i
 i |   |	 o | d IJn | d IJ| o | d | IJn | d t d IJ| d t i t i    IJ| d | IJ|	 p | d | IJn | d | IJ|	 p | d IJn | d IJt t  }" | d IJt d p |" t |! i  7}" n | d |" IJ| d IJxD t D]< }# |# i   }# x' |# i  d  D] } | | i   IJqWqWt d p x |! i i!   D] \ }$ }% t |%  o t" |$  }& |& i#   }' g  }( x1 |% D]) }) |' i$ |)  p d }* |( i% |*  qnWt& |$  o t' d   qt d }+ t( |$ | t d |(  q0q0Wn | d IJ| d IJ|	 p | d IJn | d IJ| d  t) | |  IJ| o | d! | IJn | d" t) | d | d d d  IJ| |  i i*   IJ| d IJ| d# IJ|	 p | d$ IJn | i   t d d% j o t+ | |	 d& | d' | n/ t d d( j o t, | |	 d& | d' | n |
 o  t	 |  } | | i-   IJn t. i/ | |  d) S(,   s)  
        Render the figure to hardcopy.  Set the figure patch face and
        edge colors.  This is useful because some of the GUIs have a
        gray figure face color background and you'll probably want to
        override this on hardcopy

        If outfile is a string, it is interpreted as a file name.
        If the extension matches .ep* write encapsulated postscript,
        otherwise write a stand-alone PostScript file.

        If outfile is a file object, a stand-alone PostScript file is
        written into this file object.
        R  s,   outfile must be a path or a file-like objectRF   R  s   ps.usedistilleriH   g      ?i    iZ   Rw   s   %!PS-Adobe-3.0 EPSF-3.0s   %!PS-Adobe-3.0s	   %%Title: s   %%Creator: matplotlib version s$   , http://matplotlib.sourceforge.net/s   %%CreationDate: s   %%Orientation: s   %%DocumentPaperSizes: s   %%%%BoundingBox: %d %d %d %ds
   %%Pages: 1s   %%EndCommentss   %%BeginPrologs	   ps.useafms   /mpldict %d dict defs   mpldict begins   
sy   OpenType CFF fonts can not be saved using the internal Postscript backend at this time.
Consider using the Cairo backend.s   ps.fonttypet   ends   %%EndPrologs   %%Page: 1 1s   %s translates	   %d rotates
   %s clipboxt   showpages   %%EOFt   ghostscriptt   ptypeR   t   xpdfNg      B@g      B@(0   Rg   R   R   R   Rf   R~  t
   ValueErrort   ost   closeR   R  t   get_size_inchesRK   RA   R   R   R   t   get_facecolort   get_edgecolort   set_facecolort   set_edgecolorR   Rt   Ro   R  R
   t   timet   ctimeRh   t   psDefsR   Ru  t   splitt   valuesR   R_  R   R   R   R  R   RY   Rn  t
   gs_distillt   xpdf_distillt   readt   shutilt   move(,   R   R  R  R  R  R  R  R  R  t   isEPSFt   passed_in_file_objectt   fdt   tmpfilet   titlet   fhRr   Rs   t   paperHeightt
   paperWidthR?  R@  R@   R   RF   RG   t   llxt   llyt   urxt   uryt   rotationR   t   origfacecolort   origedgecolort   renderert   NdictR   t   font_filenamet   charsR   Ri  t	   glyph_idsRg  Rl  t   fonttype(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    s    

  


 
   


    
#

 
 %

 
c	   &   
   C   s  | d j }	 | }
 t    \ } } t i |  t | d  } d |  i _ |  i i   \ } } d } d } |  i i i \ } } } } | } | } | | } | | } | | | | f } |  i i	   } |  i i
   } |  i i |  |  i i |  t   |  _ t | | |  i d | } |  i i |  |  i i |  |  i i |  | d IJ|
 o | d |
 IJn | d t d	 IJ| d
 t i t i    IJ| d | IJ| d IJt t  } | d IJ| d | IJ| d IJxD t D]< } | i   } x' | i d  D] } | | i   IJqWqW| d IJ| d IJ| d IJ| d t | |  IJ| d t | d | d d d  IJ| |  i i   IJ| d IJ| d IJ| i   | o) t } | | } } | | | | f } n t | |  }  | d j o |  } t |  \ }! }" n` t | \ }! }" | |! j p | |" j o5 |	 o. t |  \ }! }" t i d | |  f d  n | i   }# |# i    }$ |# i!   }% t" | | i# |$ |% |! |" |  t$ d d j o t% | |	 d | d | nb t$ d d j o t& | |	 d | d | n4 t$ d o( t' o qMt% | |	 d | d | n t( | t  o  t |  } | | i)   IJn t* i+ | |  d S(    s   
        If text.usetex is True in rc, a temporary pair of tex/eps files
        are created to allow tex to manage the text layout via the PSFrags
        package. These files are processed to yield the final ps or eps file.
        R  RF   iH   i    Rw   s   %!PS-Adobe-3.0 EPSF-3.0s	   %%Title: s   %%Creator: matplotlib version s$   , http://matplotlib.sourceforge.net/s   %%CreationDate: s   %%%%BoundingBox: %d %d %d %ds   %%EndCommentss   %%BeginPrologs   /mpldict %d dict defs   mpldict begins   
R  s   %%EndPrologs   %s translates
   %s clipboxR  R  sU   Your figure is too big to fit on %s paper. %s paper will be used to prevent clipping.t   helpfuls   ps.usedistillerR  R  R   R  s   text.usetexN(,   R   R  R  R   R  R  R  R   R   R  R  R  R  R   Rt   Ro   R  R
   R  R  Rh   R  Ru  R  RY   Rn  R~  RK   RA   R	   t   reportR   t   get_font_preamblet   get_custom_preamblet   convert_psfragsRv   R   R  R  Rg   RN  R  R  R  (&   R   R  R  R  R  R  R  R  R  R  R  R  R  R  Rr   Rs   R?  R@  R@   R   RF   RG   R  R  R  R  R   R  R  R  R  R   t   temp_papertypeR  R  R   t   font_preamblet   custom_preamble(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    s    


 


  


%


!	 N(   R{  R|  R  t	   filetypesR  R  R  R  Rg   Rf   R  R  (    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR  W  s   	

					c         C   s  t  i i |   d } |  d } t i |  |  |  d }	 |  d }
 t |	 d  } |  d } |  d } | d j o
 d	 } n d } t d
 o
 d } n d } d | | | | | | | d i |  | t  i i |  d f
 } t d
 o | i | i	 d   n= y | i |  Wn( t
 j
 o } t i d d    n X| i   t i d j o d t  i i |  d } n d } d | | |	 |
 f } t i | d  t  i |  } t |
  } | o t d | i     n t i | i   d  | i   t  i |
  d | | t  i i |  d t  i i |  d |
 f } t i | d  t  i |  } t |
  } | o t d | | i     n t i | i   d  | i   t  i |
  t  i |  t i | |   t p/ x, t i |  d  D] } t  i |  qWn d S(   sj  
    When we want to use the LaTeX backend with postscript, we write PSFrag tags
    to a temporary postscript file, each one marking a position for LaTeX to
    render some text. convert_psfrags generates a LaTeX document containing the
    commands to convert those tags to text. LaTeX/dvips produces the postscript
    file that includes the actual text.
    i    s   .epss   .texs   .outputRF   s   .dvis   .psR  iZ   s   text.latex.unicodes-   \usepackage{ucs}
\usepackage[utf8x]{inputenc}R   sE  \documentclass{article}
%s
%s
%s
\usepackage[dvips, papersize={%sin,%sin}, body={%sin,%sin}, margin={0in,0in}]{geometry}
\usepackage{psfrag}
\usepackage[dvips]{graphicx}
\usepackage{color}
\pagestyle{empty}
\begin{document}
\begin{figure}
\centering
\leavevmode
%s
\includegraphics*[angle=%s]{%s}
\end{figure}
\end{document}
s   
it   utf8sb   You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.R  t   win32s   %s &&s8   %s cd "%s" && latex -interaction=nonstopmode "%s" > "%s"t   debugsY   LaTeX was not able to process your file:
Here is the full report generated by LaTeX: 

%ss.   %s cd "%s" && dvips -q -R0 -o "%s" "%s" > "%s"sc   dvips was not able to process the following file:
%s
Here is the full report generated by dvips: 

s   .*N(   R  R  R  R  R  R   R   RV   R   t   encodet   UnicodeEncodeErrorR	   R  R  R   t   platformt
   splitdrivet   systemR  R  t   removeR&  t   glob(   R  t   psfragsR  R  R  R  R  t   tmpdirt   epsfilet	   latexfileR  t   latexht   dvifilet   psfileR   t   unicode_preambleRS   t   errt   precmdRw  t   exit_statusR  R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    sr    	




 

)	
 
	0 
 c         C   s  d | } |  d } |  d } t  d } t i d j o
 d } n d } d | | | | |  | f }	 t i |	 d	  t i |	  }
 t |  } |
 o t d
 | i	     n t i | i	   d	  | i
   t i |  t i |   t i | |   | o t |  |  n d S(   s   
    Use ghostscript's pswrite or epswrite device to distill a file.
    This yields smaller files without illegal encapsulated postscript
    operators. The output is low-level, converting text to outlines.
    s   -sPAPERSIZE=%ss   .pss   .outputs   ps.distiller.resR  t   gswin32ct   gss[   %s -dBATCH -dNOPAUSE -r%d -sDEVICE=pswrite %s -sOutputFile="%s"                 "%s" > "%s"R  sc   ghostscript was not able to process your image.
Here is the full report generated by ghostscript:

N(   R   R   R  R	   R  R  R  R   R  R  R  R  R  R  t   pstoeps(   R  R  R  R   t   paperR  R  R  t   gs_exeRw  R  R  (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    s*    



 
 
c         C   s  |  d } |  d } |  d } d | |  | | f } t  i d j o | i d d  } n t i | d  t i |  } t |  }	 | o t d	 |	 i	     n t i |	 i	   d  |	 i
   t i |  d
 | | | f } t i | d  t i |  } t |  }	 | o t d |	 i	     n t i |	 i	   d  |	 i
   t i |  t i |   t i | |   | o t |  |  n x( t i |  d  D] }
 t i |
  qWd S(   s
  
    Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
    This yields smaller files without illegal encapsulated postscript
    operators. This distiller is preferred, generating high-level postscript
    output that treats text as text.
    s   .pdfs   .pss   .outputsc   ps2pdf -dAutoFilterColorImages=false -sColorImageFilter=FlateEncode -sPAPERSIZE=%s "%s" "%s" > "%s"R  t   =t   #R  sZ   ps2pdf was not able to process your image.
\Here is the report generated by ghostscript:

s-   pdftops -paper match -level2 "%s" "%s" > "%s"s\   pdftops was not able to process your image.
Here is the full report generated by pdftops: 

s   .*N(   R   R  Rb   R	   R  R  R  R   R  R  R  R  R  R  R  R  (   R  R  R  R   t   pdffileR  R  Rw  R  R  R   (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    sD    


  
 
 c      	   C   s  |  d } t  i d j o
 d } n d } d | |  f } t i | d  t i |  \ } } } t i | i   d  | i   } t i | d  t i d	 |  }	 |	 o |	 i	   } n t
 d
 |   g  }
 | i   d D] } |
 t |  q ~
 \ } } } } | d j o2 | d | d | d | d f \ } } } } nw | | d } | | d } | d | d d } | d | d d } | | | | | | | | f \ } } } } d | | t i |  t i |  f } d | | | | f } d i | | g  S(   s   
    Use ghostscript's bbox device to find the center of the bounding box. Return
    an appropriately sized bbox centered around that point. A bit of a hack.
    s   .outputR  R  R  s'   %s -dBATCH -dNOPAUSE -sDEVICE=bbox "%s"R  s   debug-annoyingR  s   %%HiResBoundingBox: .*sV   Ghostscript was not able to extract a bounding box.Here is the Ghostscript output:

%sii   i   i    i   s   %%%%BoundingBox: %d %d %d %ds)   %%%%HiResBoundingBox: %.6f %.6f %.6f %.6fs   
N(   R   R  R	   R  R  t   popen3R  Rc   t   searchR_   R  R  t   floatRf   Ri   t   ceilRV   (   R  R   R  R  Rw  t   stdint   stdoutt   stderrt	   bbox_infot
   bbox_foundR   R   R@   R   R   R   R`   R   t   dxt   dyt   hires_bbox_info(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   get_bbox'  s6    
 
=2.(c         C   s  t  |  |  } |  d } t | d  } t |   } | i   } x | o | i d  o | d IJ| | IJn | i d  ol | i |  | d IJ| d IJ| d IJ| d	 IJ| d
 IJ| d IJ| d IJ| d IJ| d IJPnB | i d  p  | i d  p | i d  o n | i |  | i   } qC W| i   } x | o | i d  oW | d IJ| d IJ| d IJ| d IJ| d IJt d d j o | i   } qn | i |  | i   } qOW| i   | i   t i |   t	 i
 | |   d S(   s<   
    Convert the postscript to encapsulated postscript.
    s   .epsRF   s   %!PSs   %!PS-Adobe-3.0 EPSF-3.0s   %%EndCommentss   %%BeginPrologt   savet   countdictstackt   markR  s   /showpage {} defs   /setpagedevice {pop} defs   %%EndPrologs
   %%Page 1 1s   %%Bounds   %%HiResBounds   %%Pagess	   %%Trailert   cleartomarks   exch sub { end } repeatt   restores   ps.usedistillerR  N(   R  R   t   readlineRE   R   R   R  R  R  R  R  (   R  R   R  R  t   epsht   tmpht   line(    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR  Q  sZ    
 









 






R  c           B   s   e  Z RS(    (   R{  R|  (    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyR    s   s   /m { moveto } bind defs   /l { lineto } bind defs   /r { rlineto } bind defs   /c { curveto } bind defs   /cl { closepath } bind defsU   /box {
      m
      1 index 0 r
      0 exch r
      neg 0 r
      cl
    } bind defs<   /clipbox {
      box
      clip
      newpath
    } bind def([   R}  t
   __future__R    R  t   mathR  R  R   R  R   t   hashlibR   t   ImportErrort   tempfileR   t	   cStringIOR   t
   matplotlibR	   R
   R   t   matplotlib._pylab_helpersR   t   matplotlib.afmR   t   matplotlib.backend_basesR   R   R   R   t   matplotlib.cbookR   R   R   R   t   matplotlib.mlabR   t   matplotlib.figureR   t   matplotlib.font_managerR   R   t   matplotlib.ft2fontR   R   R   t   matplotlib.ttconvR   t   matplotlib.mathtextR   t   matplotlib._mathtext_dataR   t   matplotlib.textR    t   matplotlib.pathR!   t   matplotlib.transformsR"   t   numpyRi   R   Rc   R   t	   NameErrort   setsR#   R  RE   t	   cmd_splitt   backend_versionR&  RA   RK   RT   RY   Re   Rn   Ro   RW  R  R  R  Rg   Rf   R  R  R  R  R  t   FigureManagerR  (    (    (    sN   C:\graphics\Tools\Python26\Lib\site-packages\matplotlib\backends\backend_ps.pyt   <module>   s   H	"" 
					  	 .	_(	*	;