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
(4)
2
3
(2)
4
(3)
5
(5)
6
(1)
7
(3)
8
9
(3)
10
(3)
11
(6)
12
(2)
13
(4)
14
(1)
15
(2)
16
(1)
17
(6)
18
(8)
19
20
(1)
21
22
23
(3)
24
(2)
25
(2)
26
(1)
27
(2)
28
(7)
29
(2)
30
(4)




Showing 3 results of 3

From: <jo...@us...> - 2008年09月07日 11:28:47
Revision: 6074
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6074&view=rev
Author: jouni
Date: 2008年09月07日 11:28:45 +0000 (2008年9月07日)
Log Message:
-----------
Merged revisions 6073 via svnmerge from 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
 r6073 | jouni | 2008年09月07日 14:19:13 +0300 (2008年9月07日) | 3 lines
 
 Changed full arrows slightly to avoid an xpdf rendering
 problem reported by Friedrich Hagedorn.
........
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/patches.py
Property Changed:
----------------
 trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
 - /branches/v0_91_maint:1-6068
 + /branches/v0_91_maint:1-6073
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年09月07日 11:19:13 UTC (rev 6073)
+++ trunk/matplotlib/CHANGELOG	2008年09月07日 11:28:45 UTC (rev 6074)
@@ -1,3 +1,6 @@
+2008年09月07日 Changed full arrows slightly to avoid an xpdf rendering
+ problem reported by Friedrich Hagedorn. - JKS
+
 2008年09月07日 Fix conversion of quadratic to cubic Bezier curves in PDF 
 and PS backends. Patch by Jae-Joon Lee. - JKS
 
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2008年09月07日 11:19:13 UTC (rev 6073)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2008年09月07日 11:28:45 UTC (rev 6074)
@@ -772,7 +772,11 @@
 if shape == 'right':
 coords = right_half_arrow
 elif shape == 'full':
- coords=np.concatenate([left_half_arrow,right_half_arrow[::-1]])
+ # The half-arrows contain the midpoint of the stem,
+ # which we can omit from the full arrow. Including it
+ # twice caused a problem with xpdf.
+ coords=np.concatenate([left_half_arrow[:-1],
+ right_half_arrow[-2::-1]])
 else:
 raise ValueError, "Got unknown shape: %s" % shape
 cx = float(dx)/distance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jo...@us...> - 2008年09月07日 11:19:15
Revision: 6073
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6073&view=rev
Author: jouni
Date: 2008年09月07日 11:19:13 +0000 (2008年9月07日)
Log Message:
-----------
Changed full arrows slightly to avoid an xpdf rendering
problem reported by Friedrich Hagedorn.
Modified Paths:
--------------
 branches/v0_91_maint/CHANGELOG
 branches/v0_91_maint/lib/matplotlib/patches.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG	2008年09月07日 10:57:15 UTC (rev 6072)
+++ branches/v0_91_maint/CHANGELOG	2008年09月07日 11:19:13 UTC (rev 6073)
@@ -1,3 +1,6 @@
+2008年09月07日 Changed full arrows slightly to avoid an xpdf rendering
+ problem reported by Friedrich Hagedorn. - JKS
+
 2008年08月25日 Fix locale issues in SVG backend - MGD
 
 2008年08月01日 Backported memory leak fixes in _ttconv.cpp - MGD
Modified: branches/v0_91_maint/lib/matplotlib/patches.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/patches.py	2008年09月07日 10:57:15 UTC (rev 6072)
+++ branches/v0_91_maint/lib/matplotlib/patches.py	2008年09月07日 11:19:13 UTC (rev 6073)
@@ -634,7 +634,11 @@
 if shape == 'right':
 coords = right_half_arrow
 elif shape == 'full':
- coords=npy.concatenate([left_half_arrow,right_half_arrow[::-1]])
+ # The half-arrows contain the midpoint of the stem,
+ # which we can omit from the full arrow. Including it
+ # twice caused a problem with xpdf.
+ coords=npy.concatenate([left_half_arrow[:-1],
+ right_half_arrow[-2::-1]])
 else:
 raise ValueError, "Got unknown shape: %s" % shape
 cx = float(dx)/distance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jo...@us...> - 2008年09月07日 10:57:18
Revision: 6072
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6072&view=rev
Author: jouni
Date: 2008年09月07日 10:57:15 +0000 (2008年9月07日)
Log Message:
-----------
Fix conversion of quadratic to cubic Bezier curves in PDF 
and PS backends. Patch by Jae-Joon Lee.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/examples/tests/backend_driver.py
 trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
 trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
 trunk/matplotlib/lib/matplotlib/cbook.py
Added Paths:
-----------
 trunk/matplotlib/examples/api/quad_bezier.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2008年09月06日 21:37:53 UTC (rev 6071)
+++ trunk/matplotlib/CHANGELOG	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -1,3 +1,6 @@
+2008年09月07日 Fix conversion of quadratic to cubic Bezier curves in PDF 
+ and PS backends. Patch by Jae-Joon Lee. - JKS
+
 2008年09月06日 Added 5-point star marker to plot command - EF
 
 2008年09月05日 Fix hatching in PS backend - MGD
Added: trunk/matplotlib/examples/api/quad_bezier.py
===================================================================
--- trunk/matplotlib/examples/api/quad_bezier.py	 (rev 0)
+++ trunk/matplotlib/examples/api/quad_bezier.py	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -0,0 +1,17 @@
+import numpy as np
+import matplotlib.path as mpath
+import matplotlib.patches as mpatches
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+pp1 = mpatches.PathPatch(
+ mpath.Path([(0, 0), (1, 0), (1, 1), (0, 0)], [1, 3, 3, 5]),
+ fc="none", transform=ax.transData)
+
+ax.add_patch(pp1)
+ax.plot([0.75], [0.25], "ro")
+ax.set_title('The red point should be on the path')
+
+plt.draw()
+
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py	2008年09月06日 21:37:53 UTC (rev 6071)
+++ trunk/matplotlib/examples/tests/backend_driver.py	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -127,7 +127,8 @@
 'colorbar_only.py',
 'color_cycle.py',
 'donut_demo.py',
- 'path_patch_demo.py'
+ 'path_patch_demo.py',
+ 'quad_bezier.py'
 ]
 
 units_dir = os.path.join('..', 'units')
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年09月06日 21:37:53 UTC (rev 6071)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -26,7 +26,7 @@
 FigureManagerBase, FigureCanvasBase
 from matplotlib.backends.backend_mixed import MixedModeRenderer
 from matplotlib.cbook import Bunch, is_string_like, reverse_dict, \
- get_realpath_and_stat, is_writable_file_like, maxdict
+ get_realpath_and_stat, is_writable_file_like, maxdict, quad2cubic
 from matplotlib.figure import Figure
 from matplotlib.font_manager import findfont, is_opentype_cff_font
 from matplotlib.afm import AFM
@@ -1096,6 +1096,7 @@
 tpath = transform.transform_path(path)
 
 cmds = []
+ last_points = None
 for points, code in tpath.iter_segments():
 if code == Path.MOVETO:
 cmds.extend(points)
@@ -1104,15 +1105,15 @@
 cmds.extend(points)
 cmds.append(Op.lineto)
 elif code == Path.CURVE3:
- cmds.extend([points[0], points[1],
- points[0], points[1],
- points[2], points[3],
- Op.curveto])
+ points = quad2cubic(*(list(last_points[-2:]) + list(points)))
+ cmds.extend(points)
+ cmds.append(Op.curveto)
 elif code == Path.CURVE4:
 cmds.extend(points)
 cmds.append(Op.curveto)
 elif code == Path.CLOSEPOLY:
 cmds.append(Op.closepath)
+ last_points = points
 return cmds
 pathOperations = staticmethod(pathOperations)
 
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2008年09月06日 21:37:53 UTC (rev 6071)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -20,7 +20,7 @@
 FigureManagerBase, FigureCanvasBase
 
 from matplotlib.cbook import is_string_like, get_realpath_and_stat, \
- is_writable_file_like, maxdict
+ is_writable_file_like, maxdict, quad2cubic
 from matplotlib.figure import Figure
 
 from matplotlib.font_manager import findfont, is_opentype_cff_font
@@ -448,22 +448,23 @@
 path = transform.transform_path(path)
 
 ps = []
+ last_points = None
 for points, code in path.iter_segments():
 if code == Path.MOVETO:
 ps.append("%g %g m" % tuple(points))
 elif code == Path.LINETO:
 ps.append("%g %g l" % tuple(points))
 elif code == Path.CURVE3:
+ points = quad2cubic(*(list(last_points[-2:]) + list(points)))
 ps.append("%g %g %g %g %g %g c" %
- (points[0], points[1],
- points[0], points[1],
- points[2], points[3]))
+ tuple(points[2:]))
 elif code == Path.CURVE4:
 ps.append("%g %g %g %g %g %g c" % tuple(points))
 elif code == Path.CLOSEPOLY:
 ps.append("cl")
+ last_points = points
+ 
 ps = "\n".join(ps)
-
 return ps
 
 def _get_clip_path(self, clippath, clippath_transform):
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py	2008年09月06日 21:37:53 UTC (rev 6071)
+++ trunk/matplotlib/lib/matplotlib/cbook.py	2008年09月07日 10:57:15 UTC (rev 6072)
@@ -1390,6 +1390,20 @@
 """
 return np.all(X[0] == X[-1])
 
+def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y):
+ """
+ Converts a quadratic Bezier curve to a cubic approximation.
+
+ The inputs are the x and y coordinates of the three control points
+ of a quadratic curve, and the output is a tuple of x and y
+ coordinates of the four control points of the cubic curve.
+ """
+ # c0x, c0y = q0x, q0y
+ c1x, c1y = q0x + 2./3. * (q1x - q0x), q0y + 2./3. * (q1y - q0y)
+ c2x, c2y = c1x + 1./3. * (q2x - q0x), c1y + 1./3. * (q2y - q0y)
+ # c3x, c3y = q2x, q2y
+ return q0x, q0y, c1x, c1y, c2x, c2y, q2x, q2y
+
 # a dict to cross-map linestyle arguments
 _linestyles = [('-', 'solid'),
 ('--', 'dashed'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 3 results of 3

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 によって変換されたページ (->オリジナル) /