Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffcd8a9

Browse files
committed
Merged revisions 6660-6662 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6660 | jdh2358 | 2008-12-18 07:10:51 -0500 (Thu, 18 Dec 2008) | 1 line applied maxosx backend update ........ r6661 | mdboom | 2008-12-18 08:41:35 -0500 (Thu, 18 Dec 2008) | 2 lines Fix bug where a line with NULL data limits prevents subsequent data limits from calculating correctly ........ r6662 | mdboom | 2008-12-18 08:42:13 -0500 (Thu, 18 Dec 2008) | 2 lines Fix docstring typo. ........ svn path=/trunk/matplotlib/; revision=6663
1 parent 2e4d4bd commit ffcd8a9

6 files changed

Lines changed: 1509 additions & 330 deletions

File tree

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2008-12-18 Fix bug where a line with NULL data limits prevents
2+
subsequent data limits from calculating correctly - MGD
3+
4+
2008-12-17 Major documentation generator changes - MGD
5+
6+
2008-12-17 Applied macosx backend patch with support for path
7+
collections, quadmesh, etc... - JDH
8+
19
2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
210
-JJL
311

doc/_templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends "layout.html" %}
2-
{% set title = 'Overview' %}
2+
{% set title = 'matplotlib: python plotting' %}
33

44

55
{% block body %}

doc/api/font_manager_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matplotlib font_manager
1111
:show-inheritance:
1212

1313
:mod:`matplotlib.fontconfig_pattern`
14-
========================================
14+
====================================
1515

1616
.. automodule:: matplotlib.fontconfig_pattern
1717
:members:

lib/matplotlib/backends/backend_macosx.py

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from matplotlib.figure import Figure
1111
from matplotlib.path import Path
1212
from matplotlib.mathtext import MathTextParser
13+
from matplotlib.colors import colorConverter
1314

1415

1516

@@ -48,34 +49,47 @@ def set_width_height (self, width, height):
4849
self.width, self.height = width, height
4950

5051
def draw_path(self, gc, path, transform, rgbFace=None):
51-
path = transform.transform_path(path)
52-
for points, code in path.iter_segments():
53-
if code == Path.MOVETO:
54-
gc.moveto(points)
55-
elif code == Path.LINETO:
56-
gc.lineto(points)
57-
elif code == Path.CURVE3:
58-
gc.curve3(points)
59-
elif code == Path.CURVE4:
60-
gc.curve4(points)
61-
elif code == Path.CLOSEPOLY:
62-
gc.closepoly()
6352
if rgbFace is not None:
6453
rgbFace = tuple(rgbFace)
65-
gc.stroke(rgbFace)
54+
if gc!=self.gc:
55+
n = self.gc.level() - gc.level()
56+
for i in range(n): self.gc.restore()
57+
self.gc = gc
58+
gc.draw_path(path, transform, rgbFace)
59+
60+
def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None):
61+
if rgbFace is not None:
62+
rgbFace = tuple(rgbFace)
63+
if gc!=self.gc:
64+
n = self.gc.level() - gc.level()
65+
for i in range(n): self.gc.restore()
66+
self.gc = gc
67+
gc.draw_markers(marker_path, marker_trans, path, trans, rgbFace)
68+
69+
def draw_path_collection(self, *args):
70+
gc = self.gc
71+
args = args[:13]
72+
gc.draw_path_collection(*args)
73+
74+
def draw_quad_mesh(self, *args):
75+
gc = self.gc
76+
gc.draw_quad_mesh(*args)
6677

6778
def new_gc(self):
6879
self.gc.reset()
6980
return self.gc
7081

7182
def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
72-
self.gc.set_clip_rectangle(bbox)
7383
im.flipud_out()
7484
nrows, ncols, data = im.as_rgba_str()
75-
self.gc.draw_image(x, y, nrows, ncols, data)
85+
self.gc.draw_image(x, y, nrows, ncols, data, bbox, clippath, clippath_trans)
7686
im.flipud_out()
7787

7888
def draw_tex(self, gc, x, y, s, prop, angle):
89+
if gc!=self.gc:
90+
n = self.gc.level() - gc.level()
91+
for i in range(n): self.gc.restore()
92+
self.gc = gc
7993
# todo, handle props, angle, origins
8094
size = prop.get_size_in_points()
8195
texmanager = self.get_texmanager()
@@ -88,12 +102,20 @@ def draw_tex(self, gc, x, y, s, prop, angle):
88102
gc.draw_mathtext(x, y, angle, Z)
89103

90104
def _draw_mathtext(self, gc, x, y, s, prop, angle):
105+
if gc!=self.gc:
106+
n = self.gc.level() - gc.level()
107+
for i in range(n): self.gc.restore()
108+
self.gc = gc
91109
size = prop.get_size_in_points()
92110
ox, oy, width, height, descent, image, used_characters = \
93111
self.mathtext_parser.parse(s, self.dpi, prop)
94112
gc.draw_mathtext(x, y, angle, 255 - image.as_array())
95113

96114
def draw_text(self, gc, x, y, s, prop, angle, ismath=False):
115+
if gc!=self.gc:
116+
n = self.gc.level() - gc.level()
117+
for i in range(n): self.gc.restore()
118+
self.gc = gc
97119
if ismath:
98120
self._draw_mathtext(gc, x, y, s, prop, angle)
99121
else:
@@ -143,6 +165,11 @@ def __init__(self):
143165
GraphicsContextBase.__init__(self)
144166
_macosx.GraphicsContext.__init__(self)
145167

168+
def set_foreground(self, fg, isRGB=False):
169+
if not isRGB:
170+
fg = colorConverter.to_rgb(fg)
171+
_macosx.GraphicsContext.set_foreground(self, fg)
172+
146173
def set_clip_rectangle(self, box):
147174
GraphicsContextBase.set_clip_rectangle(self, box)
148175
if not box: return
@@ -152,19 +179,7 @@ def set_clip_path(self, path):
152179
GraphicsContextBase.set_clip_path(self, path)
153180
if not path: return
154181
path = path.get_fully_transformed_path()
155-
for points, code in path.iter_segments():
156-
if code == Path.MOVETO:
157-
self.moveto(points)
158-
elif code == Path.LINETO:
159-
self.lineto(points)
160-
elif code == Path.CURVE3:
161-
self.curve3(points)
162-
elif code == Path.CURVE4:
163-
self.curve4(points)
164-
elif code == Path.CLOSEPOLY:
165-
self.closepoly()
166-
self.clip_path()
167-
182+
_macosx.GraphicsContext.set_clip_path(self, path)
168183

169184
########################################################################
170185
#

0 commit comments

Comments
 (0)