SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(12)
2
(3)
3
(3)
4
(3)
5
(6)
6
(3)
7
8
(2)
9
10
(1)
11
(2)
12
(1)
13
(9)
14
(5)
15
(7)
16
(2)
17
18
19
(7)
20
(1)
21
(2)
22
23
24
25
(3)
26
27
28
29
(2)

Showing 1 results of 1

From: <jo...@us...> - 2008年02月10日 15:22:00
Revision: 4950
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4950&view=rev
Author: jouni
Date: 2008年02月10日 07:21:56 -0800 (2008年2月10日)
Log Message:
-----------
Fixed a problem with square roots in the pdf backend with usetex.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年02月08日 21:09:33 UTC (rev 4949)
+++ trunk/matplotlib/CHANGELOG	2008年02月10日 15:21:56 UTC (rev 4950)
@@ -1,3 +1,6 @@
+2008年02月10日 Fixed a problem with square roots in the pdf backend with
+ usetex. - JKS
+
 2008年02月08日 Fixed minor __str__ bugs so getp(gca()) works. - JKS
 
 2008年02月05日 Added getters for title, xlabel, ylabel, as requested
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年02月08日 21:09:33 UTC (rev 4949)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年02月10日 15:21:56 UTC (rev 4950)
@@ -35,7 +35,7 @@
 from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE, \
 LOAD_NO_HINTING, KERNING_UNFITTED
 from matplotlib.mathtext import MathTextParser
-from matplotlib.transforms import Bbox, BboxBase
+from matplotlib.transforms import Affine2D, Bbox, BboxBase
 from matplotlib.path import Path
 from matplotlib import ttconv
 
@@ -1331,14 +1331,6 @@
 page = iter(dvi).next()
 dvi.close()
 
- if angle == 0: # avoid rounding errors in common case
- def mytrans(x1, y1):
- return x+x1, y+y1
- else:
- def mytrans(x1, y1, x=x, y=y, a=angle / 180.0 * pi):
- return x + cos(a)*x1 - sin(a)*y1, \
- y + sin(a)*x1 + cos(a)*y1
-
 # Gather font information and do some setup for combining
 # characters into strings.
 oldfont, seq = None, []
@@ -1354,7 +1346,6 @@
 seq += [['font', pdfname, dvifont.size]]
 oldfont = dvifont
 seq += [['text', x1, y1, [chr(glyph)], x1+width]]
- seq += [('end',)]
 
 # Find consecutive text strings with constant x coordinate and
 # combine into a sequence of strings and kerns, or just one
@@ -1374,7 +1365,10 @@
 continue
 i += 1
 
- # Now do the actual output.
+ # Create a transform to map the dvi contents to the canvas.
+ mytrans = Affine2D().rotate_deg(angle).translate(x, y)
+
+ # Output the text.
 self.check_gc(gc, gc._rgb)
 self.file.output(Op.begin_text)
 curx, cury, oldx, oldy = 0, 0, 0, 0
@@ -1382,7 +1376,7 @@
 if elt[0] == 'font':
 self.file.output(elt[1], elt[2], Op.selectfont)
 elif elt[0] == 'text':
- curx, cury = mytrans(elt[1], elt[2])
+ curx, cury = mytrans.transform((elt[1], elt[2]))
 self._setup_textpos(curx, cury, angle, oldx, oldy)
 oldx, oldy = curx, cury
 if len(elt[3]) == 1:
@@ -1390,20 +1384,20 @@
 else:
 self.file.output(elt[3], Op.showkern)
 else:
- assert elt[0] == 'end'
+ assert False
 self.file.output(Op.end_text)
 
- # Finally output the boxes (used for the variable-length lines
- # in square roots and the like).
+ # Then output the boxes (e.g. variable-length lines of square
+ # roots).
 boxgc = self.new_gc()
 boxgc.copy_properties(gc)
 boxgc.set_linewidth(0)
+ pathops = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
 for x1, y1, h, w in page.boxes:
- (x1, y1), (x2, y2), (x3, y3), (x4, y4) = \
- mytrans(x1, y1), mytrans(x1+w, y1), \
- mytrans(x1+w, y1+h), mytrans(x1, y1+h)
- self.draw_polygon(boxgc, gc._rgb,
- ((x1,y1), (x2,y2), (x3,y3), (x4,y4)))
+ path = Path([[x1, y1], [x1+w, y1], [x1+w, y1+h], [x1, y1+h],
+ [0,0]], pathops)
+ self.draw_path(boxgc, path, mytrans, gc._rgb)
 
 def encode_string(self, s, fonttype):
 if fonttype == 3:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /