@@ -23,8 +23,8 @@ def get_text_width_height(self, s, prop, ismath):
2323 """
2424 fontsize = prop .get_size_in_points ()
2525 l ,b ,r ,t = self .texmanager .get_ps_bbox (s )
26- w = (r - l )# *fontsize/10.
27- h = (t - b )# *fontsize/10.
26+ w = (r - l )* fontsize / 10.
27+ h = (t - b )* fontsize / 10.
2828 #print s, w, h
2929 return w , h
3030
@@ -37,15 +37,13 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath):
3737 corr = 0 #w/2*(fontsize-10)/10
3838 pos = _nums_to_str (x - corr , y )
3939 thetext = 'psmarker%d' % self .textcnt
40- setcolor = '%1.3f %1.3f %1.3f setrgbcolor' % gc .get_rgb ()
4140 scale = float (fontsize / 10.0 )
42- color = r'\rgb %1.3f %1.3f %1.3f'% gc .get_rgb ()
43- tex = '\color{ rgb} {%s}' % s
44- self .psfrag .append (r'\psfrag{%s}[bl][bl][%f][%f]{%s}' % (thetext , scale , angle , s ))
41+ color = ' %1.3f, %1.3f, %1.3f'% gc .get_rgb ()
42+ tex = r '\color[ rgb] {%s} %s' % ( color , s )
43+ self .psfrag .append (r'\psfrag{%s}[bl][bl][%f][%f]{%s}' % (thetext , scale , angle , tex ))
4544 ps = """\
4645 gsave
4746%(pos)s moveto
48- %(setcolor)s
4947(%(thetext)s)
5048show
5149grestore
@@ -55,8 +53,6 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath):
5553 self .textcnt += 1
5654
5755
58-
59-
6056class FigureCanvasLatex (FigureCanvasBase ):
6157 basepath = get_data_path ()
6258
@@ -82,7 +78,7 @@ def print_figure(self, outfile, dpi=72,
8278 latexh = file (outfile , 'w' )
8379
8480 # center the figure on the paper
85- self .figure .dpi .set (72 ) # ignore the passsed dpi setting for PS
81+ self .figure .dpi .set (72 ) # ignore the passed dpi setting for PS
8682 width , height = self .figure .get_size_inches ()
8783
8884 if orientation == 'landscape' :
@@ -161,14 +157,13 @@ def print_figure(self, outfile, dpi=72,
161157 print >> latexh , r"""\documentclass{article}
162158\usepackage{psfrag}
163159\usepackage[dvips]{graphicx}
160+ \usepackage{color}
164161\pagestyle{empty}
165162\begin{document}
166163
167-
168164\begin{figure}[t]
169165 %s
170- \resizebox{5.5in}{!}{\includegraphics{%s}}
171-
166+ \scalebox{1}{\includegraphics{%s}}
172167\end{figure}
173168
174169\end{document}
0 commit comments