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
|
|
From: <lee...@us...> - 2009-09-04 19:11:12
|
Revision: 7635
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7635&view=rev
Author: leejjoon
Date: 2009-09-04 19:11:00 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
textpath support mathtext and tex
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/pylab_examples/demo_text_path.py
trunk/matplotlib/lib/matplotlib/mathtext.py
trunk/matplotlib/lib/matplotlib/text.py
trunk/matplotlib/src/ft2font.cpp
trunk/matplotlib/src/ft2font.h
Added Paths:
-----------
trunk/matplotlib/lib/matplotlib/textpath.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/CHANGELOG 2009-09-04 19:11:00 UTC (rev 7635)
@@ -1,3 +1,6 @@
+2009-09-04 Make the textpath class as a separate moduel
+ (textpath.py). Add support for mathtext and tex.- JJL
+
2009-09-01 Added support for Gouraud interpolated triangles.
pcolormesh now accepts shading='gouraud' as an option. - MGD
Modified: trunk/matplotlib/examples/pylab_examples/demo_text_path.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/demo_text_path.py 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/examples/pylab_examples/demo_text_path.py 2009-09-04 19:11:00 UTC (rev 7635)
@@ -76,23 +76,52 @@
# make anchored offset box
ao = AnchoredOffsetbox(loc=2, child=offsetbox, frameon=True, borderpad=0.2)
-
ax.add_artist(ao)
+ # another text
+ from matplotlib.patches import PathPatch
+ text_path = TextPath((0, 0), r"\mbox{textpath supports mathtext \& \TeX}",
+ size=20, usetex=True)
+ p1 = PathPatch(text_path, ec="w", lw=3, fc="w", alpha=0.9,
+ transform=IdentityTransform())
+ p2 = PathPatch(text_path, ec="none", fc="k",
+ transform=IdentityTransform())
+ offsetbox2 = AuxTransformBox(IdentityTransform())
+ offsetbox2.add_artist(p1)
+ offsetbox2.add_artist(p2)
+ ab = AnnotationBbox(offsetbox2, (0.95, 0.05),
+ xycoords='axes fraction',
+ boxcoords="offset points",
+ box_alignment=(1.,0.),
+ frameon=False
+ )
+ ax.add_artist(ab)
+
+ ax.imshow([[0,1,2],[1,2,3]], cmap=plt.cm.gist_gray_r,
+ interpolation="bilinear",
+ aspect="auto")
+
+
+
# EXAMPLE 2
ax = plt.subplot(212)
arr = np.arange(256).reshape(1,256)/256.
- text_path = TextPath((0, 0), "TextPath", size=70)
+ usetex = plt.rcParams["text.usetex"]
+ if usetex:
+ s = r"$\displaystyle\left[\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}\right]$!"
+ else:
+ s = r"$\left[\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}\right]$!"
+ text_path = TextPath((0, 0), s, size=40, usetex=usetex)
text_patch = PathClippedImagePatch(text_path, arr, ec="none",
transform=IdentityTransform())
- shadow1 = mpatches.Shadow(text_patch, 3, -2, props=dict(fc="none", ec="0.6", lw=3))
- shadow2 = mpatches.Shadow(text_patch, 3, -2, props=dict(fc="0.3", ec="none"))
+ shadow1 = mpatches.Shadow(text_patch, 1, -1, props=dict(fc="none", ec="0.6", lw=3))
+ shadow2 = mpatches.Shadow(text_patch, 1, -1, props=dict(fc="0.3", ec="none"))
# make offset box
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2009-09-04 19:11:00 UTC (rev 7635)
@@ -336,6 +336,34 @@
svg_elements,
self.fonts_object.get_used_characters())
+class MathtextBackendPath(MathtextBackend):
+ """
+ Store information to write a mathtext rendering to the Cairo
+ backend.
+ """
+
+ def __init__(self):
+ self.glyphs = []
+ self.rects = []
+
+ def render_glyph(self, ox, oy, info):
+ oy = self.height - oy + info.offset
+ thetext = unichr(info.num)
+ self.glyphs.append(
+ (info.font, info.fontsize, thetext, ox, oy))
+
+ def render_rect_filled(self, x1, y1, x2, y2):
+ self.rects.append(
+ (x1, self.height-y2 , x2 - x1, y2 - y1))
+
+ def get_results(self, box):
+ ship(0, -self.depth, box)
+ return (self.width,
+ self.height + self.depth,
+ self.depth,
+ self.glyphs,
+ self.rects)
+
class MathtextBackendCairo(MathtextBackend):
"""
Store information to write a mathtext rendering to the Cairo
@@ -2751,6 +2779,7 @@
'ps' : MathtextBackendPs,
'pdf' : MathtextBackendPdf,
'svg' : MathtextBackendSvg,
+ 'path' : MathtextBackendPath,
'cairo' : MathtextBackendCairo,
'macosx': MathtextBackendAgg,
}
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/lib/matplotlib/text.py 2009-09-04 19:11:00 UTC (rev 7635)
@@ -1770,173 +1770,4 @@
docstring.interpd.update(Annotation=Annotation.__init__.__doc__)
-class TextPath(Path):
- """
- Create a path from the text.
- """
-
- # TODO : math text is currently not supported, but it would not be easy.
-
- FONT_SCALE = 100.
-
- def __init__(self, xy, s, size=None, prop=None,
- _interpolation_steps=1,
- *kl, **kwargs):
- """
- Create a path from the text. No support for TeX yet. Note that
- it simply is a path, not an artist. You need to use the
- PathPatch (or other artists) to draw this path onto the
- canvas.
-
- xy : position of the text.
- s : text
- size : font size
- prop : font property
- """
-
-
- if prop is None:
- prop = FontProperties()
-
- if size is None:
- size = prop.get_size_in_points()
-
-
- self._xy = xy
- self.set_size(size)
-
- self._cached_vertices = None
-
- self._vertices, self._codes = self.text_get_vertices_codes(prop, s)
-
- self.should_simplify = False
- self.simplify_threshold = rcParams['path.simplify_threshold']
- self.has_nonfinite = False
- self._interpolation_steps = _interpolation_steps
-
-
- def set_size(self, size):
- """
- set the size of the text
- """
- self._size = size
- self._invalid = True
-
- def get_size(self):
- """
- get the size of the text
- """
- return self._size
-
- def _get_vertices(self):
- """
- Return the cached path after updating it if necessary.
- """
- self._revalidate_path()
- return self._cached_vertices
-
- def _get_codes(self):
- """
- Return the codes
- """
- return self._codes
-
- vertices = property(_get_vertices)
- codes = property(_get_codes)
-
- def _revalidate_path(self):
- """
- update the path if necessary.
-
- The path for the text is initially create with the font size
- of FONT_SCALE, and this path is rescaled to other size when
- necessary.
-
- """
- if self._invalid or \
- (self._cached_vertices is None):
- tr = Affine2D().scale(self._size/self.FONT_SCALE,
- self._size/self.FONT_SCALE).translate(*self._xy)
- self._cached_vertices = tr.transform(self._vertices)
- self._invalid = False
-
-
- def glyph_char_path(self, glyph, currx=0.):
- """
- convert the glyph to vertices and codes. Mostly copied from
- backend_svg.py.
- """
- verts, codes = [], []
- for step in glyph.path:
- if step[0] == 0: # MOVE_TO
- verts.append((step[1], step[2]))
- codes.append(Path.MOVETO)
- elif step[0] == 1: # LINE_TO
- verts.append((step[1], step[2]))
- codes.append(Path.LINETO)
- elif step[0] == 2: # CURVE3
- verts.extend([(step[1], step[2]),
- (step[3], step[4])])
- codes.extend([Path.CURVE3, Path.CURVE3])
- elif step[0] == 3: # CURVE4
- verts.extend([(step[1], step[2]),
- (step[3], step[4]),
- (step[5], step[6])])
- codes.extend([Path.CURVE4, Path.CURVE4, Path.CURVE4])
- elif step[0] == 4: # ENDPOLY
- verts.append((0, 0,))
- codes.append(Path.CLOSEPOLY)
-
- verts = [(x+currx, y) for (x,y) in verts]
-
- return verts, codes
-
-
- def text_get_vertices_codes(self, prop, s):
- """
- convert the string *s* to vertices and codes using the
- provided font property *prop*. Mostly copied from
- backend_svg.py.
- """
-
- fname = font_manager.findfont(prop)
- font = FT2Font(str(fname))
-
- font.set_size(self.FONT_SCALE, 72)
-
- cmap = font.get_charmap()
- lastgind = None
-
- currx = 0
-
- verts, codes = [], []
-
-
- # I'm not sure if I get kernings right. Needs to be verified. -JJL
-
- for c in s:
-
- ccode = ord(c)
- gind = cmap.get(ccode)
- if gind is None:
- ccode = ord('?')
- gind = 0
- glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
-
-
- if lastgind is not None:
- kern = font.get_kerning(lastgind, gind, KERNING_DEFAULT)
- else:
- kern = 0
- currx += (kern / 64.0) #/ (self.FONT_SCALE)
-
- verts1, codes1 = self.glyph_char_path(glyph, currx)
- verts.extend(verts1)
- codes.extend(codes1)
-
-
- currx += (glyph.linearHoriAdvance / 65536.0) #/ (self.FONT_SCALE)
- lastgind = gind
-
- return verts, codes
-
+from matplotlib.textpath import TextPath
Added: trunk/matplotlib/lib/matplotlib/textpath.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/textpath.py (rev 0)
+++ trunk/matplotlib/lib/matplotlib/textpath.py 2009-09-04 19:11:00 UTC (rev 7635)
@@ -0,0 +1,463 @@
+# -*- coding: utf-8 -*-
+
+import urllib
+from matplotlib.path import Path
+import matplotlib.font_manager as font_manager
+
+from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING, LOAD_TARGET_LIGHT
+
+from matplotlib.mathtext import MathTextParser
+
+import matplotlib.dviread as dviread
+from matplotlib.texmanager import TexManager
+
+import numpy as np
+
+class TextToPath(object):
+ """
+ A class that convert a given text to a path using ttf fonts.
+ """
+
+ FONT_SCALE = 50.
+ DPI = 72
+
+ def __init__(self):
+ """
+ Initialization
+ """
+ self.mathtext_parser = MathTextParser('path')
+ self.tex_font_map = None
+
+ from matplotlib.cbook import maxdict
+ self._ps_fontd = maxdict(50)
+
+
+ def _get_font(self, prop):
+ """
+ find a ttf font.
+ """
+ fname = font_manager.findfont(prop)
+ font = FT2Font(str(fname))
+ font.set_size(self.FONT_SCALE, self.DPI)
+
+ return font
+
+
+ def _get_char_id(self, font, ccode):
+ """
+ Return a unique id for the given font and character-code set.
+ """
+ ps_name = font.get_sfnt()[(1,0,0,6)]
+ char_id = urllib.quote('%s-%d' % (ps_name, ccode))
+ return char_id
+
+ def _get_char_id_ps(self, font, ccode):
+ """
+ Return a unique id for the given font and character-code set (for tex).
+ """
+ ps_name = font.get_ps_font_info()[2]
+ char_id = urllib.quote('%s-%d' % (ps_name, ccode))
+ return char_id
+
+
+ def glyph_to_path(self, glyph, currx=0.):
+ """
+ convert the ft2font glyph to vertices and codes.
+ """
+ #Mostly copied from backend_svg.py.
+
+ verts, codes = [], []
+ for step in glyph.path:
+ if step[0] == 0: # MOVE_TO
+ verts.append((step[1], step[2]))
+ codes.append(Path.MOVETO)
+ elif step[0] == 1: # LINE_TO
+ verts.append((step[1], step[2]))
+ codes.append(Path.LINETO)
+ elif step[0] == 2: # CURVE3
+ verts.extend([(step[1], step[2]),
+ (step[3], step[4])])
+ codes.extend([Path.CURVE3, Path.CURVE3])
+ elif step[0] == 3: # CURVE4
+ verts.extend([(step[1], step[2]),
+ (step[3], step[4]),
+ (step[5], step[6])])
+ codes.extend([Path.CURVE4, Path.CURVE4, Path.CURVE4])
+ elif step[0] == 4: # ENDPOLY
+ verts.append((0, 0,))
+ codes.append(Path.CLOSEPOLY)
+
+ verts = [(x+currx, y) for (x,y) in verts]
+ return verts, codes
+
+
+ def get_text_path(self, prop, s, ismath=False, usetex=False):
+ """
+ convert text *s* to path (a tuple of vertices and codes for matplotlib.math.Path).
+
+ *prop*
+ font property
+
+ *s*
+ text to be converted
+
+ *usetex*
+ If True, use matplotlib usetex mode.
+
+ *ismath*
+ If True, use mathtext parser. Effective only if usetex == False.
+
+
+ """
+ if usetex==False:
+ if ismath == False:
+ font = self._get_font(prop)
+ glyph_info, glyph_map, rects = self.get_glyphs_with_font(font, s)
+ else:
+ glyph_info, glyph_map, rects = self.get_glyphs_mathtext(prop, s)
+ else:
+ glyph_info, glyph_map, rects = self.get_glyphs_tex(prop, s)
+
+ verts, codes = [], []
+
+ for glyph_id, xposition, yposition, scale in glyph_info:
+ verts1, codes1 = glyph_map[glyph_id]
+ if verts1:
+ verts1 = np.array(verts1)*scale + [xposition, yposition]
+ verts.extend(verts1)
+ codes.extend(codes1)
+
+ for verts1, codes1 in rects:
+ verts.extend(verts1)
+ codes.extend(codes1)
+
+ return verts, codes
+
+
+ def get_glyphs_with_font(self, font, s, glyph_map=None):
+ """
+ convert the string *s* to vertices and codes using the
+ provided ttf font.
+ """
+
+ # Mostly copied from backend_svg.py.
+
+ cmap = font.get_charmap()
+ lastgind = None
+
+ currx = 0
+ xpositions = []
+ glyph_ids = []
+
+ if glyph_map is None:
+ glyph_map = dict()
+
+ # I'm not sure if I get kernings right. Needs to be verified. -JJL
+
+ for c in s:
+
+
+ ccode = ord(c)
+ gind = cmap.get(ccode)
+ if gind is None:
+ ccode = ord('?')
+ gind = 0
+
+ if lastgind is not None:
+ kern = font.get_kerning(lastgind, gind, KERNING_DEFAULT)
+ else:
+ kern = 0
+
+
+ glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
+ horiz_advance = (glyph.linearHoriAdvance / 65536.0)
+
+ char_id = self._get_char_id(font, ccode)
+ if not char_id in glyph_map:
+ glyph_map[char_id] = self.glyph_to_path(glyph)
+
+ currx += (kern / 64.0)
+
+ xpositions.append(currx)
+ glyph_ids.append(char_id)
+
+ currx += horiz_advance
+
+ lastgind = gind
+
+ ypositions = [0] * len(xpositions)
+ sizes = [1.] * len(xpositions)
+
+ rects = []
+
+ return zip(glyph_ids, xpositions, ypositions, sizes), glyph_map, rects
+
+
+
+
+ def get_glyphs_mathtext(self, prop, s):
+ """
+ convert the string *s* to vertices and codes by parsing it with mathtext.
+ """
+
+ prop = prop.copy()
+ prop.set_size(self.FONT_SCALE)
+
+ width, height, descent, glyphs, rects = self.mathtext_parser.parse(
+ s, self.DPI, prop)
+
+
+ glyph_map = dict()
+
+ xpositions = []
+ ypositions = []
+ glyph_ids = []
+ sizes = []
+
+ currx, curry = 0, 0
+ for font, fontsize, s, ox, oy in glyphs:
+
+ ccode = ord(s)
+ char_id = self._get_char_id(font, ccode)
+ if not char_id in glyph_map:
+ font.clear()
+ font.set_size(self.FONT_SCALE, self.DPI)
+ glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
+ glyph_map[char_id] = self.glyph_to_path(glyph)
+
+ xpositions.append(ox)
+ ypositions.append(oy)
+ glyph_ids.append(char_id)
+ size = fontsize / self.FONT_SCALE
+ sizes.append(size)
+
+ myrects = []
+ for ox, oy, w, h in rects:
+ vert1=[(ox, oy), (ox, oy+h), (ox+w, oy+h), (ox+w, oy), (ox, oy), (0,0)]
+ code1 = [Path.MOVETO,
+ Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
+ myrects.append((vert1, code1))
+
+
+ return zip(glyph_ids, xpositions, ypositions, sizes), glyph_map, myrects
+
+
+
+ def get_glyphs_tex(self, prop, s):
+ """
+ convert the string *s* to vertices and codes using matplotlib's usetex mode.
+ """
+
+ # codes are modstly borrowed from pdf backend.
+
+ texmanager = TexManager()
+
+ if self.tex_font_map is None:
+ self.tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
+
+ fontsize = prop.get_size_in_points()
+ if hasattr(texmanager, "get_dvi"): #
+ dvifilelike = texmanager.get_dvi(s, self.FONT_SCALE)
+ dvi = dviread.DviFromFileLike(dvifilelike, self.DPI)
+ else:
+ dvifile = texmanager.make_dvi(s, self.FONT_SCALE)
+ dvi = dviread.Dvi(dvifile, self.DPI)
+ page = iter(dvi).next()
+ dvi.close()
+
+ glyph_ids, xpositions, ypositions, sizes = [], [], [], []
+ glyph_map = dict()
+
+ # Gather font information and do some setup for combining
+ # characters into strings.
+ #oldfont, seq = None, []
+ for x1, y1, dvifont, glyph, width in page.text:
+ font_and_encoding = self._ps_fontd.get(dvifont.texname)
+
+ if font_and_encoding is None:
+ font_bunch = self.tex_font_map[dvifont.texname]
+ font = FT2Font(font_bunch.filename)
+ if font_bunch.encoding:
+ enc = dviread.Encoding(font_bunch.encoding)
+ else:
+ enc = None
+ self._ps_fontd[dvifont.texname] = font, enc
+
+ else:
+ font, enc = font_and_encoding
+
+ ft2font_flag = LOAD_TARGET_LIGHT
+ if enc:
+ ng = font.get_name_index(enc.encoding[glyph])
+ else:
+ ng = glyph
+
+ char_id = self._get_char_id_ps(font, ng)
+
+ if not char_id in glyph_map:
+ font.clear()
+ font.set_size(self.FONT_SCALE, self.DPI)
+
+ if ng == 0:
+ # While 0 is a valid index (e.g., "-", "\Gamma"),
+ # font.load_glyph(0) does not seem to work. This
+ # may not be a general solution.
+ glyph0 = font.load_glyph(128, flags=ft2font_flag)
+ else:
+ glyph0 = font.load_glyph(ng, flags=ft2font_flag)
+
+ glyph_map[char_id] = self.glyph_to_path(glyph0)
+
+ glyph_ids.append(char_id)
+ xpositions.append(x1)
+ ypositions.append(y1)
+ sizes.append(dvifont.size/self.FONT_SCALE)
+
+ myrects = []
+
+ for ox, oy, h, w in page.boxes:
+ vert1=[(ox, oy), (ox+w, oy), (ox+w, oy+h), (ox, oy+h), (ox, oy), (0,0)]
+ code1 = [Path.MOVETO,
+ Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
+ myrects.append((vert1, code1))
+
+
+ return zip(glyph_ids, xpositions, ypositions, sizes), glyph_map, myrects
+
+
+
+
+
+
+from matplotlib.font_manager import FontProperties
+from matplotlib import rcParams
+from matplotlib.transforms import Affine2D
+
+text_to_path = TextToPath()
+
+class TextPath(Path):
+ """
+ Create a path from the text.
+ """
+
+ def __init__(self, xy, s, size=None, prop=None,
+ _interpolation_steps=1, usetex=False,
+ *kl, **kwargs):
+ """
+ Create a path from the text. No support for TeX yet. Note that
+ it simply is a path, not an artist. You need to use the
+ PathPatch (or other artists) to draw this path onto the
+ canvas.
+
+ xy : position of the text.
+ s : text
+ size : font size
+ prop : font property
+ """
+
+
+ if prop is None:
+ prop = FontProperties()
+
+ if size is None:
+ size = prop.get_size_in_points()
+
+
+ self._xy = xy
+ self.set_size(size)
+
+ self._cached_vertices = None
+
+ self._vertices, self._codes = self.text_get_vertices_codes(prop, s, usetex=usetex)
+
+ self.should_simplify = False
+ self.simplify_threshold = rcParams['path.simplify_threshold']
+ self.has_nonfinite = False
+ self._interpolation_steps = _interpolation_steps
+
+
+ def set_size(self, size):
+ """
+ set the size of the text
+ """
+ self._size = size
+ self._invalid = True
+
+ def get_size(self):
+ """
+ get the size of the text
+ """
+ return self._size
+
+ def _get_vertices(self):
+ """
+ Return the cached path after updating it if necessary.
+ """
+ self._revalidate_path()
+ return self._cached_vertices
+
+ def _get_codes(self):
+ """
+ Return the codes
+ """
+ return self._codes
+
+ vertices = property(_get_vertices)
+ codes = property(_get_codes)
+
+ def _revalidate_path(self):
+ """
+ update the path if necessary.
+
+ The path for the text is initially create with the font size
+ of FONT_SCALE, and this path is rescaled to other size when
+ necessary.
+
+ """
+ if self._invalid or \
+ (self._cached_vertices is None):
+ tr = Affine2D().scale(self._size/text_to_path.FONT_SCALE,
+ self._size/text_to_path.FONT_SCALE).translate(*self._xy)
+ self._cached_vertices = tr.transform(self._vertices)
+ self._invalid = False
+
+
+ def is_math_text(self, s):
+ """
+ Returns True if the given string *s* contains any mathtext.
+ """
+ # copied from Text.is_math_text -JJL
+
+ # Did we find an even number of non-escaped dollar signs?
+ # If so, treat is as math text.
+ dollar_count = s.count(r'$') - s.count(r'\$')
+ even_dollars = (dollar_count > 0 and dollar_count % 2 == 0)
+
+ if rcParams['text.usetex']:
+ return s, 'TeX'
+
+ if even_dollars:
+ return s, True
+ else:
+ return s.replace(r'\$', '$'), False
+
+ def text_get_vertices_codes(self, prop, s, usetex):
+ """
+ convert the string *s* to vertices and codes using the
+ provided font property *prop*. Mostly copied from
+ backend_svg.py.
+ """
+
+ if usetex:
+ verts, codes = text_to_path.get_text_path(prop, s, usetex=True)
+ else:
+ clean_line, ismath = self.is_math_text(s)
+ verts, codes = text_to_path.get_text_path(prop, clean_line, ismath=ismath)
+
+ return verts, codes
+
+
+
+
Modified: trunk/matplotlib/src/ft2font.cpp
===================================================================
--- trunk/matplotlib/src/ft2font.cpp 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/src/ft2font.cpp 2009-09-04 19:11:00 UTC (rev 7635)
@@ -1105,6 +1105,51 @@
return Py::asObject(gm);
}
+
+char FT2Font::load_glyph__doc__[] =
+"load_glyph(glyphindex, flags=LOAD_FORCE_AUTOHINT)\n"
+"\n"
+"Load character with glyphindex in current fontfile and set glyph.\n"
+"The flags argument can be a bitwise-or of the LOAD_XXX constants.\n"
+"Return value is a Glyph object, with attributes\n"
+" width # glyph width\n"
+" height # glyph height\n"
+" bbox # the glyph bbox (xmin, ymin, xmax, ymax)\n"
+" horiBearingX # left side bearing in horizontal layouts\n"
+" horiBearingY # top side bearing in horizontal layouts\n"
+" horiAdvance # advance width for horizontal layout\n"
+" vertBearingX # left side bearing in vertical layouts\n"
+" vertBearingY # top side bearing in vertical layouts\n"
+" vertAdvance # advance height for vertical layout\n"
+;
+Py::Object
+FT2Font::load_glyph(const Py::Tuple & args, const Py::Dict & kwargs) {
+ _VERBOSE("FT2Font::load_glyph");
+ //load a char using the unsigned long charcode
+
+ args.verify_length(1);
+ long glyph_index = Py::Long(args[0]), flags = Py::Long(FT_LOAD_FORCE_AUTOHINT);
+ if (kwargs.hasKey("flags"))
+ flags = Py::Long(kwargs["flags"]);
+
+ int error = FT_Load_Glyph( face, glyph_index, flags );
+
+ if (error)
+ throw Py::RuntimeError(Printf("Could not load glyph index %d", glyph_index).str());
+
+ FT_Glyph thisGlyph;
+ error = FT_Get_Glyph( face->glyph, &thisGlyph );
+
+ if (error)
+ throw Py::RuntimeError(Printf("Could not get glyph for glyph index %d", glyph_index).str());
+
+ size_t num = glyphs.size(); //the index into the glyphs list
+ glyphs.push_back(thisGlyph);
+ Glyph* gm = new Glyph(face, thisGlyph, num);
+ return Py::asObject(gm);
+}
+
+
char FT2Font::get_width_height__doc__[] =
"w, h = get_width_height()\n"
"\n"
@@ -1782,6 +1827,8 @@
FT2Font::get_num_glyphs__doc__);
add_keyword_method("load_char", &FT2Font::load_char,
FT2Font::load_char__doc__);
+ add_keyword_method("load_glyph", &FT2Font::load_glyph,
+ FT2Font::load_glyph__doc__);
add_keyword_method("set_text", &FT2Font::set_text,
FT2Font::set_text__doc__);
add_varargs_method("set_size", &FT2Font::set_size,
Modified: trunk/matplotlib/src/ft2font.h
===================================================================
--- trunk/matplotlib/src/ft2font.h 2009-09-04 04:12:16 UTC (rev 7634)
+++ trunk/matplotlib/src/ft2font.h 2009-09-04 19:11:00 UTC (rev 7635)
@@ -99,6 +99,7 @@
Py::Object get_kerning(const Py::Tuple & args);
Py::Object get_num_glyphs(const Py::Tuple & args);
Py::Object load_char(const Py::Tuple & args, const Py::Dict & kws);
+ Py::Object load_glyph(const Py::Tuple & args, const Py::Dict & kws);
Py::Object get_width_height(const Py::Tuple & args);
Py::Object get_descent(const Py::Tuple & args);
Py::Object draw_rect_filled(const Py::Tuple & args);
@@ -140,6 +141,7 @@
static char get_glyph__doc__ [];
static char get_num_glyphs__doc__ [];
static char load_char__doc__ [];
+ static char load_glyph__doc__ [];
static char get_width_height__doc__ [];
static char get_descent__doc__ [];
static char get_kerning__doc__ [];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-09-04 04:12:27
|
Revision: 7634
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7634&view=rev
Author: leejjoon
Date: 2009-09-04 04:12:16 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
Merged revisions 7633 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7633 | leejjoon | 2009-09-03 23:35:25 -0400 (Thu, 03 Sep 2009) | 1 line
fix a bug in axes_grid.inset_locator.inset_axes
........
Modified Paths:
--------------
trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/examples/misc/multiprocess.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7618
+ /branches/mathtex:1-7263 /branches/v0_99_maint:1-7633 /branches/v0_98_5_maint:1-7253
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-09-04 03:35:25 UTC (rev 7633)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-09-04 04:12:16 UTC (rev 7634)
@@ -271,10 +271,10 @@
axes_class = Axes
if axes_kwargs is None:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position())
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position())
else:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position(),
- **axes_kwargs)
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position(),
+ **axes_kwargs)
axes_locator = AnchoredSizeLocator(parent_axes.bbox,
width, height,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-09-04 03:35:35
|
Revision: 7633
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7633&view=rev
Author: leejjoon
Date: 2009-09-04 03:35:25 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
fix a bug in axes_grid.inset_locator.inset_axes
Modified Paths:
--------------
branches/v0_99_maint/lib/mpl_toolkits/axes_grid/inset_locator.py
Modified: branches/v0_99_maint/lib/mpl_toolkits/axes_grid/inset_locator.py
===================================================================
--- branches/v0_99_maint/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-09-03 16:01:00 UTC (rev 7632)
+++ branches/v0_99_maint/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-09-04 03:35:25 UTC (rev 7633)
@@ -271,10 +271,10 @@
axes_class = Axes
if axes_kwargs is None:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position())
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position())
else:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position(),
- **axes_kwargs)
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position(),
+ **axes_kwargs)
axes_locator = AnchoredSizeLocator(parent_axes.bbox,
width, height,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-03 16:01:07
|
Revision: 7632
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7632&view=rev
Author: astraw
Date: 2009-09-03 16:01:00 +0000 (Thu, 03 Sep 2009)
Log Message:
-----------
Testing: mark test with knownfailure decorator
This will let the buildbots detect any new errors while we figure out
what's going on with this one.
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-09-03 14:36:37 UTC (rev 7631)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-09-03 16:01:00 UTC (rev 7632)
@@ -43,6 +43,7 @@
pass
#--------------------------------------------------------------------
+ @knownfailureif(True, "Fails due to SF bug 2850075")
def test_empty_datetime( self ):
"""Test plotting empty axes with dates along one axis."""
fname = self.outFile( "empty_datetime.png" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-03 14:36:46
|
Revision: 7631
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7631&view=rev
Author: mdboom
Date: 2009-09-03 14:36:37 +0000 (Thu, 03 Sep 2009)
Log Message:
-----------
Remove unnecessary line.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2009-09-02 20:48:06 UTC (rev 7630)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2009-09-03 14:36:37 UTC (rev 7631)
@@ -1218,7 +1218,6 @@
if self._shading == 'gouraud':
triangles, colors = self.convert_mesh_to_triangles(
self._meshWidth, self._meshHeight, coordinates)
- check = {}
renderer.draw_gouraud_triangles(gc, triangles, colors, transform.frozen())
else:
renderer.draw_quad_mesh(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-02 20:48:23
|
Revision: 7630
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7630&view=rev
Author: mdboom
Date: 2009-09-02 20:48:06 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Add Gouraud triangle support to PS backend.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-09-02 19:31:32 UTC (rev 7629)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-09-02 20:48:06 UTC (rev 7630)
@@ -754,6 +754,57 @@
""" % locals()
self._pswriter.write(ps)
+ def draw_gouraud_triangle(self, gc, points, colors, trans):
+ self.draw_gouraud_triangles(gc, points.reshape((1, 3, 2)),
+ colors.reshape((1, 3, 4)), trans)
+
+ def draw_gouraud_triangles(self, gc, points, colors, trans):
+ assert len(points) == len(colors)
+ assert points.ndim == 3
+ assert points.shape[1] == 3
+ assert points.shape[2] == 2
+ assert colors.ndim == 3
+ assert colors.shape[1] == 3
+ assert colors.shape[2] == 4
+
+ points = trans.transform(points)
+
+ shape = points.shape
+ flat_points = points.reshape((shape[0] * shape[1], 2))
+ flat_colors = colors.reshape((shape[0] * shape[1], 4))
+ points_min = npy.min(flat_points, axis=0) - (1 << 8)
+ points_max = npy.max(flat_points, axis=0) + (1 << 8)
+ factor = float(0xffffffff) / (points_max - points_min)
+
+ xmin, ymin = points_min
+ xmax, ymax = points_max
+
+ streamarr = npy.empty(
+ (shape[0] * shape[1],),
+ dtype=[('flags', 'u1'),
+ ('points', '>u4', (2,)),
+ ('colors', 'u1', (3,))])
+ streamarr['flags'] = 0
+ streamarr['points'] = (flat_points - points_min) * factor
+ streamarr['colors'] = flat_colors[:, :3] * 255.0
+
+ stream = quote_ps_string(streamarr.tostring())
+
+ self._pswriter.write("""
+gsave
+<< /ShadingType 4
+ /ColorSpace [/DeviceRGB]
+ /BitsPerCoordinate 32
+ /BitsPerComponent 8
+ /BitsPerFlag 8
+ /AntiAlias true
+ /Decode [ %(xmin)f %(xmax)f %(ymin)f %(ymax)f 0 1 0 1 0 1 ]
+ /DataSource (%(stream)s)
+>>
+shfill
+grestore
+""" % locals())
+
def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
"""
Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-02 19:31:41
|
Revision: 7629
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7629&view=rev
Author: mdboom
Date: 2009-09-02 19:31:32 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Add Gouraud triangle support (of a fashion) to SVG backend.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2009-09-02 19:30:30 UTC (rev 7628)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2009-09-02 19:31:32 UTC (rev 7629)
@@ -2,6 +2,8 @@
import os, codecs, base64, tempfile, urllib, gzip, cStringIO
+import numpy as np
+
try:
from hashlib import md5
except ImportError:
@@ -54,6 +56,7 @@
self._path_collection_id = 0
self._imaged = {}
self._hatchd = {}
+ self._n_gradients = 0
self.mathtext_parser = MathTextParser('SVG')
svgwriter.write(svgProlog%(width,height,width,height))
@@ -298,6 +301,63 @@
self._path_collection_id += 1
+ def draw_gouraud_triangle(self, gc, points, colors, trans):
+ # This uses a method described here:
+ #
+ # http://www.svgopen.org/2005/papers/Converting3DFaceToSVG/index.html
+ #
+ # that uses three overlapping linear gradients to simulate a
+ # Gouraud triangle. Each gradient goes from fully opaque in
+ # one corner to fully transparent along the opposite edge.
+ # The line between the stop points is perpendicular to the
+ # opposite edge. Underlying these three gradients is a solid
+ # triangle whose color is the average of all three points.
+
+ trans_and_flip = self._make_flip_transform(trans)
+ tpoints = trans_and_flip.transform(points)
+ write = self._svgwriter.write
+
+ write('<defs>')
+ for i in range(3):
+ x1, y1 = points[i]
+ x2, y2 = points[(i + 1) % 3]
+ x3, y3 = points[(i + 2) % 3]
+ c = colors[i][:3]
+
+ if x2 == x3:
+ xb = x2
+ yb = y1
+ elif y2 == y3:
+ xb = x1
+ yb = y2
+ else:
+ m1 = (y2 - y3) / (x2 - x3)
+ b1 = y2 - (m1 * x2)
+ m2 = -(1.0 / m1)
+ b2 = y1 - (m2 * x1)
+ xb = (-b1 + b2) / (m1 - m2)
+ yb = m2 * xb + b2
+
+ write('<linearGradient id="GR%x_%d" x1="%f" y1="%f" x2="%f" y2="%f" gradientUnits="userSpaceOnUse">' %
+ (self._n_gradients, i, x1, y1, xb, yb))
+ write('<stop offset="0" stop-color="%s" stop-opacity="1.0"/>' % rgb2hex(c))
+ write('<stop offset="1" stop-color="%s" stop-opacity="0.0"/>' % rgb2hex(c))
+ write('</linearGradient>')
+
+ # Define the triangle itself as a "def" since we use it 4 times
+ write('<polygon id="GT%x" points="%f %f %f %f %f %f"/>' %
+ (self._n_gradients, x1, y1, x2, y2, x3, y3))
+ write('</defs>\n')
+
+ avg_color = np.sum(colors[:, :3], axis=0) / 3.0
+ write('<use xlink:href="#GT%x" fill="%s"/>\n' %
+ (self._n_gradients, rgb2hex(avg_color)))
+ for i in range(3):
+ write('<use xlink:href="#GT%x" fill="url(#GR%x_%d)" filter="url(#colorAdd)"/>\n' %
+ (self._n_gradients, self._n_gradients, i))
+
+ self._n_gradients += 1
+
def draw_image(self, gc, x, y, im):
# MGDTODO: Support clippath here
trans = [1,0,0,1,0,0]
@@ -305,7 +365,7 @@
if rcParams['svg.image_noscale']:
trans = list(im.get_matrix())
trans[5] = -trans[5]
- transstr = 'transform="matrix(%f %f %f %f %f %f)" '%tuple(trans)
+ transstr = 'transform="matrix(%f %f %f %f %f %f)" ' % tuple(trans)
assert trans[1] == 0
assert trans[2] == 0
numrows,numcols = im.get_size()
@@ -672,4 +732,5 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="svg1">
+<filter id="colorAdd"><feComposite in="SourceGraphic" in2="BackgroundImage" operator="arithmetic" k2="1" k3="1"/></filter>
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-02 19:30:44
|
Revision: 7628
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7628&view=rev
Author: mdboom
Date: 2009-09-02 19:30:30 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Improve memory management and error handling in draw_gouraud_triangle(s) in the Agg backend.
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2009-09-02 00:44:16 UTC (rev 7627)
+++ trunk/matplotlib/src/_backend_agg.cpp 2009-09-02 19:30:30 UTC (rev 7628)
@@ -1094,14 +1094,14 @@
throw Py::ValueError("Offsets array must be Nx2");
}
- PyArrayObject* facecolors = (PyArrayObject*)PyArray_FromObject
+ facecolors = (PyArrayObject*)PyArray_FromObject
(facecolors_obj.ptr(), PyArray_DOUBLE, 1, 2);
if (!facecolors ||
(PyArray_NDIM(facecolors) == 1 && PyArray_DIM(facecolors, 0) != 0) ||
(PyArray_NDIM(facecolors) == 2 && PyArray_DIM(facecolors, 1) != 4))
throw Py::ValueError("Facecolors must be a Nx4 numpy array or empty");
- PyArrayObject* edgecolors = (PyArrayObject*)PyArray_FromObject
+ edgecolors = (PyArrayObject*)PyArray_FromObject
(edgecolors_obj.ptr(), PyArray_DOUBLE, 1, 2);
if (!edgecolors ||
(PyArray_NDIM(edgecolors) == 1 && PyArray_DIM(edgecolors, 0) != 0) ||
@@ -1459,13 +1459,14 @@
RendererAgg::_draw_gouraud_triangle(const GCAgg& gc,
const double* points, const double* colors, agg::trans_affine trans) {
- typedef agg::rgba8 color_t;
- typedef agg::span_gouraud_rgba<color_t> span_gen_t;
- typedef agg::span_allocator<color_t> span_alloc_t;
+ typedef agg::rgba8 color_t;
+ typedef agg::span_gouraud_rgba<color_t> span_gen_t;
+ typedef agg::span_allocator<color_t> span_alloc_t;
theRasterizer.reset_clipping();
rendererBase.reset_clipping(true);
set_clipbox(gc.cliprect, theRasterizer);
+ /* TODO: Support clip paths */
trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_translation(0.0, (double)height);
@@ -1492,8 +1493,8 @@
0.5);
theRasterizer.add_path(span_gen);
- agg::render_scanlines_aa(
- theRasterizer, slineP8, rendererBase, span_alloc, span_gen);
+
+ agg::render_scanlines_aa(theRasterizer, slineP8, rendererBase, span_alloc, span_gen);
}
Py::Object
@@ -1501,36 +1502,40 @@
_VERBOSE("RendererAgg::draw_gouraud_triangle");
args.verify_length(4);
- //segments, trans, clipbox, colors, linewidths, antialiaseds
GCAgg gc(args[0], dpi);
Py::Object points_obj = args[1];
Py::Object colors_obj = args[2];
agg::trans_affine trans = py_to_agg_transformation_matrix(args[3].ptr());
- PyArrayObject* points = (PyArrayObject*)PyArray_ContiguousFromAny
- (points_obj.ptr(), PyArray_DOUBLE, 2, 2);
- if (!points ||
- PyArray_DIM(points, 0) != 3 || PyArray_DIM(points, 1) != 2)
- throw Py::ValueError("points must be a 3x2 numpy array");
+ PyArrayObject* points = NULL;
+ PyArrayObject* colors = NULL;
- PyArrayObject* colors = (PyArrayObject*)PyArray_ContiguousFromAny
- (colors_obj.ptr(), PyArray_DOUBLE, 2, 2);
- if (!colors ||
- PyArray_DIM(colors, 0) != 3 || PyArray_DIM(colors, 1) != 4)
- throw Py::ValueError("colors must be a 3x4 numpy array");
+ try {
+ points = (PyArrayObject*)PyArray_ContiguousFromAny
+ (points_obj.ptr(), PyArray_DOUBLE, 2, 2);
+ if (!points ||
+ PyArray_DIM(points, 0) != 3 || PyArray_DIM(points, 1) != 2) {
+ throw Py::ValueError("points must be a 3x2 numpy array");
+ }
- try {
+ colors = (PyArrayObject*)PyArray_ContiguousFromAny
+ (colors_obj.ptr(), PyArray_DOUBLE, 2, 2);
+ if (!colors ||
+ PyArray_DIM(colors, 0) != 3 || PyArray_DIM(colors, 1) != 4) {
+ throw Py::ValueError("colors must be a 3x4 numpy array");
+ }
+
_draw_gouraud_triangle(
gc, (double*)PyArray_DATA(points), (double*)PyArray_DATA(colors), trans);
} catch (...) {
- Py_DECREF(points);
- Py_DECREF(colors);
+ Py_XDECREF(points);
+ Py_XDECREF(colors);
throw;
}
- Py_DECREF(points);
- Py_DECREF(colors);
+ Py_XDECREF(points);
+ Py_XDECREF(colors);
return Py::Object();
}
@@ -1544,42 +1549,45 @@
typedef agg::span_gouraud_rgba<color_t> span_gen_t;
typedef agg::span_allocator<color_t> span_alloc_t;
- //segments, trans, clipbox, colors, linewidths, antialiaseds
GCAgg gc(args[0], dpi);
Py::Object points_obj = args[1];
Py::Object colors_obj = args[2];
agg::trans_affine trans = py_to_agg_transformation_matrix(args[3].ptr());
- PyArrayObject* points = (PyArrayObject*)PyArray_ContiguousFromAny
- (points_obj.ptr(), PyArray_DOUBLE, 3, 3);
- if (!points ||
- PyArray_DIM(points, 1) != 3 || PyArray_DIM(points, 2) != 2)
- throw Py::ValueError("points must be a Nx3x2 numpy array");
+ PyArrayObject* points = NULL;
+ PyArrayObject* colors = NULL;
- PyArrayObject* colors = (PyArrayObject*)PyArray_ContiguousFromAny
- (colors_obj.ptr(), PyArray_DOUBLE, 3, 3);
- if (!colors ||
- PyArray_DIM(colors, 1) != 3 || PyArray_DIM(colors, 2) != 4)
- throw Py::ValueError("colors must be a Nx3x4 numpy array");
+ try {
+ points = (PyArrayObject*)PyArray_ContiguousFromAny
+ (points_obj.ptr(), PyArray_DOUBLE, 3, 3);
+ if (!points ||
+ PyArray_DIM(points, 1) != 3 || PyArray_DIM(points, 2) != 2) {
+ throw Py::ValueError("points must be a Nx3x2 numpy array");
+ }
- if (PyArray_DIM(points, 0) != PyArray_DIM(colors, 0)) {
- throw Py::ValueError("points and colors arrays must be the same length");
- }
+ colors = (PyArrayObject*)PyArray_ContiguousFromAny
+ (colors_obj.ptr(), PyArray_DOUBLE, 3, 3);
+ if (!colors ||
+ PyArray_DIM(colors, 1) != 3 || PyArray_DIM(colors, 2) != 4) {
+ throw Py::ValueError("colors must be a Nx3x4 numpy array");
+ }
- try {
+ if (PyArray_DIM(points, 0) != PyArray_DIM(colors, 0)) {
+ throw Py::ValueError("points and colors arrays must be the same length");
+ }
+
for (int i = 0; i < PyArray_DIM(points, 0); ++i) {
- _draw_gouraud_triangle(
- gc, (double*)PyArray_GETPTR1(points, i), (double*)PyArray_GETPTR1(colors, i), trans);
+ _draw_gouraud_triangle(gc, (double*)PyArray_GETPTR1(points, i), (double*)PyArray_GETPTR1(colors, i), trans);
}
} catch (...) {
- Py_DECREF(points);
- Py_DECREF(colors);
+ Py_XDECREF(points);
+ Py_XDECREF(colors);
throw;
}
- Py_DECREF(points);
- Py_DECREF(colors);
+ Py_XDECREF(points);
+ Py_XDECREF(colors);
return Py::Object();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-02 00:44:23
|
Revision: 7627
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7627&view=rev
Author: mdehoon
Date: 2009-09-02 00:44:16 +0000 (Wed, 02 Sep 2009)
Log Message:
-----------
Allowing mouse dragging with three-button mice.
Modified Paths:
--------------
trunk/matplotlib/src/_macosx.m
Modified: trunk/matplotlib/src/_macosx.m
===================================================================
--- trunk/matplotlib/src/_macosx.m 2009-09-01 14:44:50 UTC (rev 7626)
+++ trunk/matplotlib/src/_macosx.m 2009-09-02 00:44:16 UTC (rev 7627)
@@ -349,8 +349,10 @@
- (void)mouseMoved:(NSEvent*)event;
- (void)rightMouseDown:(NSEvent*)event;
- (void)rightMouseUp:(NSEvent*)event;
+- (void)rightMouseDragged:(NSEvent*)event;
- (void)otherMouseDown:(NSEvent*)event;
- (void)otherMouseUp:(NSEvent*)event;
+- (void)otherMouseDragged:(NSEvent*)event;
- (void)setRubberband:(NSRect)rect;
- (void)removeRubberband;
- (const char*)convertKeyEvent:(NSEvent*)event;
@@ -4744,6 +4746,23 @@
PyGILState_Release(gstate);
}
+- (void)rightMouseDragged:(NSEvent *)event
+{
+ int x, y;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* result = PyObject_CallMethod(canvas, "motion_notify_event", "ii", x, y);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
- (void)otherMouseDown:(NSEvent *)event
{
int x, y;
@@ -4784,6 +4803,23 @@
PyGILState_Release(gstate);
}
+- (void)otherMouseDragged:(NSEvent *)event
+{
+ int x, y;
+ NSPoint location = [event locationInWindow];
+ location = [self convertPoint: location fromView: nil];
+ x = location.x;
+ y = location.y;
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* result = PyObject_CallMethod(canvas, "motion_notify_event", "ii", x, y);
+ if(result)
+ Py_DECREF(result);
+ else
+ PyErr_Print();
+
+ PyGILState_Release(gstate);
+}
+
- (void)setRubberband:(NSRect)rect
{
if (!NSIsEmptyRect(rubberband)) [self setNeedsDisplayInRect: rubberband];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2009-09-01 14:45:03
|
Revision: 7626
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7626&view=rev
Author: jswhit
Date: 2009-09-01 14:44:50 +0000 (Tue, 01 Sep 2009)
Log Message:
-----------
mask data outside plot region in contourf
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2009-09-01 14:06:35 UTC (rev 7625)
+++ trunk/toolkits/basemap/Changelog 2009-09-01 14:44:50 UTC (rev 7626)
@@ -1,4 +1,6 @@
version 0.99.5 (not yet released)
+ * in contourf method, mask data outside map projection region
+ (this prevents contourf from erroneously filling entire map).
* added 'nightshade' method to shade night regions on a map.
'daynight.py' example added to illustrate usage.
* added lonmin, lonmax instance variables.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-01 14:06:43
|
Revision: 7625
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7625&view=rev
Author: mdehoon
Date: 2009-09-01 14:06:35 +0000 (Tue, 01 Sep 2009)
Log Message:
-----------
Adding calls to gc.restore() whenever new_gc is called. This is necessary for the Mac OS X and the Cairo backend to work correctly. Also, updating the Mac OS X backend to be consistent with recent changes in SVN. See issue 2844845 on sourceforge.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-09-01 13:03:20 UTC (rev 7624)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-09-01 14:06:35 UTC (rev 7625)
@@ -1749,6 +1749,7 @@
self.patch.get_transform()))
renderer.draw_image(gc, round(l), round(b), im)
+ gc.restore()
if dsu_rasterized:
for zorder, i, a in dsu_rasterized:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-09-01 13:03:20 UTC (rev 7624)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-09-01 14:06:35 UTC (rev 7625)
@@ -58,21 +58,42 @@
rgbFace = tuple(rgbFace)
gc.draw_markers(marker_path, marker_trans, path, trans, rgbFace)
- def draw_path_collection(self, *args):
- # TODO: We should change this in the C code eventually, but this
- # re-ordering of arguments should work for now
- gc = args[0]
- args = tuple([gc, args[1], gc.get_clip_rectangle()] + \
- list(gc.get_clip_path()) + list(args[2:]))
- gc.draw_path_collection(*args)
+ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
+ offsets, offsetTrans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls):
+ cliprect = gc.get_clip_rectangle()
+ clippath, clippath_transform = gc.get_clip_path()
+ gc.draw_path_collection(master_transform,
+ cliprect,
+ clippath,
+ clippath_transform,
+ paths,
+ all_transforms,
+ offsets,
+ offsetTrans,
+ facecolors,
+ edgecolors,
+ linewidths,
+ linestyles,
+ antialiaseds)
- def draw_quad_mesh(self, *args):
- # TODO: We should change this in the C code eventually, but this
- # re-ordering of arguments should work for now
- gc = args[0]
- args = [gc, args[1], gc.get_clip_rectangle()] + \
- list(gc.get_clip_path()) + list(args[2:])
- gc.draw_quad_mesh(*args)
+ def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
+ coordinates, offsets, offsetTrans, facecolors,
+ antialiased, showedges):
+ cliprect = gc.get_clip_rectangle()
+ clippath, clippath_transform = gc.get_clip_path()
+ gc.draw_quad_mesh(master_transform,
+ cliprect,
+ clippath,
+ clippath_transform,
+ meshWidth,
+ meshHeight,
+ coordinates,
+ offsets,
+ offsetTrans,
+ facecolors,
+ antialiased,
+ showedges)
def new_gc(self):
self.gc.save()
@@ -80,8 +101,6 @@
return self.gc
def draw_image(self, gc, x, y, im):
- # TODO: We should change this in the C code eventually, but this
- # re-ordering of arguments should work for now
im.flipud_out()
nrows, ncols, data = im.as_rgba_str()
gc.draw_image(x, y, nrows, ncols, data, gc.get_clip_rectangle(),
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2009-09-01 13:03:20 UTC (rev 7624)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2009-09-01 14:06:35 UTC (rev 7625)
@@ -214,6 +214,8 @@
gc, transform.frozen(), paths, self.get_transforms(),
offsets, transOffset, self.get_facecolor(), self.get_edgecolor(),
self._linewidths, self._linestyles, self._antialiaseds, self._urls)
+
+ gc.restore()
renderer.close_group(self.__class__.__name__)
def contains(self, mouseevent):
@@ -1223,6 +1225,7 @@
gc, transform.frozen(), self._meshWidth, self._meshHeight,
coordinates, offsets, transOffset, self.get_facecolor(),
self._antialiased, self._showedges)
+ gc.restore()
renderer.close_group(self.__class__.__name__)
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2009-09-01 13:03:20 UTC (rev 7624)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2009-09-01 14:06:35 UTC (rev 7625)
@@ -766,6 +766,7 @@
gc.set_clip_rectangle(self.bbox)
gc.set_clip_path(self.get_clip_path())
renderer.draw_image(gc, l, b, im)
+ gc.restore()
# render the axes
for a in self.axes: a.draw(renderer)
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2009-09-01 13:03:20 UTC (rev 7624)
+++ trunk/matplotlib/lib/matplotlib/image.py 2009-09-01 14:06:35 UTC (rev 7625)
@@ -142,6 +142,7 @@
gc.set_clip_rectangle(self.axes.bbox.frozen())
gc.set_clip_path(self.get_clip_path())
renderer.draw_image(gc, l, b, im)
+ gc.restore()
def contains(self, mouseevent):
"""
@@ -637,6 +638,7 @@
round(self.axes.bbox.xmin),
round(self.axes.bbox.ymin),
im)
+ gc.restore()
def set_data(self, x, y, A):
@@ -790,6 +792,7 @@
gc.set_clip_rectangle(self.figure.bbox)
gc.set_clip_path(self.get_clip_path())
renderer.draw_image(gc, round(self.ox), round(self.oy), im)
+ gc.restore()
def write_png(self, fname):
"""Write the image to png file with fname"""
@@ -931,6 +934,7 @@
self._set_gc_clip(gc)
#gc.set_clip_path(self.get_clip_path())
renderer.draw_image(gc, round(l), round(b), im)
+ gc.restore()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-01 13:22:32
|
Revision: 7623
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7623&view=rev
Author: mdboom
Date: 2009-09-01 12:13:12 +0000 (Tue, 01 Sep 2009)
Log Message:
-----------
Add CHANGELOG entry about Gouraud shading
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-09-01 05:24:38 UTC (rev 7622)
+++ trunk/matplotlib/CHANGELOG 2009-09-01 12:13:12 UTC (rev 7623)
@@ -1,3 +1,6 @@
+2009-09-01 Added support for Gouraud interpolated triangles.
+ pcolormesh now accepts shading='gouraud' as an option. - MGD
+
2009-08-29 Added matplotlib.testing package, which contains a Nose
plugin and a decorator that lets tests be marked as
KnownFailures - ADS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-09-01 13:03:27
|
Revision: 7624
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7624&view=rev
Author: mdboom
Date: 2009-09-01 13:03:20 +0000 (Tue, 01 Sep 2009)
Log Message:
-----------
Use numpy to generate the PDF shading triangles stream, which should be faster and more portable than using struct.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-09-01 12:13:12 UTC (rev 7623)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-09-01 13:03:20 UTC (rev 7624)
@@ -17,7 +17,6 @@
from cStringIO import StringIO
from datetime import datetime
from math import ceil, cos, floor, pi, sin
-import struct
try:
set
except NameError:
@@ -1068,11 +1067,10 @@
gouraudDict[name] = ob
shape = points.shape
flat_points = points.reshape((shape[0] * shape[1], 2))
+ flat_colors = colors.reshape((shape[0] * shape[1], 4))
points_min = npy.min(flat_points, axis=0) - (1 << 8)
points_max = npy.max(flat_points, axis=0) + (1 << 8)
factor = float(0xffffffff) / (points_max - points_min)
- adjpoints = npy.array((points - points_min) * factor, dtype=npy.uint32)
- adjcolors = npy.array(colors * 255.0, dtype=npy.uint8)
self.beginStream(
ob.id, None,
@@ -1087,10 +1085,16 @@
0, 1, 0, 1, 0, 1]
})
- for tpoints, tcolors in zip(adjpoints, adjcolors):
- for p, c in zip(tpoints, tcolors):
- values = [int(x) for x in [0] + list(p) + list(c[:3])]
- self.write(struct.pack('>BLLBBB', *values))
+ streamarr = npy.empty(
+ (shape[0] * shape[1],),
+ dtype=[('flags', 'u1'),
+ ('points', '>u4', (2,)),
+ ('colors', 'u1', (3,))])
+ streamarr['flags'] = 0
+ streamarr['points'] = (flat_points - points_min) * factor
+ streamarr['colors'] = flat_colors[:, :3] * 255.0
+
+ self.write(streamarr.tostring())
self.endStream()
self.writeObject(self.gouraudObject, gouraudDict)
@@ -1375,11 +1379,20 @@
colors.reshape((1, 3, 4)), trans)
def draw_gouraud_triangles(self, gc, points, colors, trans):
+ assert len(points) == len(colors)
+ assert points.ndim == 3
+ assert points.shape[1] == 3
+ assert points.shape[2] == 2
+ assert colors.ndim == 3
+ assert colors.shape[1] == 3
+ assert colors.shape[2] == 4
+
shape = points.shape
points = points.reshape((shape[0] * shape[1], 2))
tpoints = trans.transform(points)
tpoints = tpoints.reshape(shape)
name = self.file.addGouraudTriangles(tpoints, colors)
+ self.check_gc(gc)
self.file.output(name, Op.shading)
def _setup_textpos(self, x, y, descent, angle, oldx=0, oldy=0, olddescent=0, oldangle=0):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-09-01 05:24:46
|
Revision: 7622
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7622&view=rev
Author: jouni
Date: 2009-09-01 05:24:38 +0000 (Tue, 01 Sep 2009)
Log Message:
-----------
Small fix to Gouraud triangles in pdf
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-08-31 20:10:35 UTC (rev 7621)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-09-01 05:24:38 UTC (rev 7622)
@@ -141,6 +141,11 @@
r = "%.10f" % obj
return r.rstrip('0').rstrip('.')
+ # Booleans. Needs to be tested before integers since
+ # isinstance(True, int) is true.
+ elif isinstance(obj, bool):
+ return ['false', 'true'][obj]
+
# Integers are written as such.
elif isinstance(obj, (int, long)):
return "%d" % obj
@@ -170,10 +175,6 @@
r.append("]")
return fill(r)
- # Booleans.
- elif isinstance(obj, bool):
- return ['false', 'true'][obj]
-
# The null keyword.
elif obj is None:
return 'null'
@@ -1080,7 +1081,7 @@
'BitsPerComponent': 8,
'BitsPerFlag': 8,
'ColorSpace': Name('DeviceRGB'),
- 'AntiAlias': 1,
+ 'AntiAlias': True,
'Decode': [points_min[0], points_max[0],
points_min[1], points_max[1],
0, 1, 0, 1, 0, 1]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-08-31 20:10:45
|
Revision: 7621
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7621&view=rev
Author: mdboom
Date: 2009-08-31 20:10:35 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Add "draw_gouraud_triangles" (note the 's') backend method. Add initial support in Pdf backend (working in xpdf and evince, but not in acroread, strangely).
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_backend_agg.h
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2009-08-31 20:10:35 UTC (rev 7621)
@@ -170,10 +170,31 @@
"""
Draw a Gouraud-shaded triangle.
- EXPERIMENTAL
+ *points* is a 3x2 array of (x, y) points for the triangle.
+
+ *colors* is a 3x4 array of RGBA colors for each point of the
+ triangle.
+
+ *transform* is an affine transform to apply to the points.
"""
raise NotImplementedError
+ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
+ transform):
+ """
+ Draws a series of Gouraud triangles.
+
+ *points* is a Nx3x2 array of (x, y) points for the trianglex.
+
+ *colors* is a Nx3x4 array of RGBA colors for each point of the
+ triangles.
+
+ *transform* is an affine transform to apply to the points.
+ """
+ transform = transform.frozen()
+ for tri, col in zip(triangles_array, colors_array):
+ self.draw_gouraud_triangle(gc, tri, col, transform)
+
def _iter_collection_raw_paths(self, master_transform, paths,
all_transforms):
"""
@@ -410,7 +431,7 @@
def start_rasterizing(self):
"""
- Used in MixedModeRenderer. Switch to the raster renderer.
+ Used in MixedModeRenderer. Switch to the raster renderer.
"""
pass
@@ -425,7 +446,7 @@
def start_filter(self):
"""
Used in AggRenderer. Switch to a temporary renderer for image
- filtering effects.
+ filtering effects.
"""
pass
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 20:10:35 UTC (rev 7621)
@@ -80,6 +80,7 @@
self.draw_path_collection = self._renderer.draw_path_collection
self.draw_quad_mesh = self._renderer.draw_quad_mesh
self.draw_gouraud_triangle = self._renderer.draw_gouraud_triangle
+ self.draw_gouraud_triangles = self._renderer.draw_gouraud_triangles
self.draw_image = self._renderer.draw_image
self.copy_from_bbox = self._renderer.copy_from_bbox
self.tostring_rgba_minimized = self._renderer.tostring_rgba_minimized
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2009-08-31 20:10:35 UTC (rev 7621)
@@ -58,7 +58,8 @@
finalize flipy get_canvas_width_height get_image_magnification
get_texmanager get_text_width_height_descent new_gc open_group
option_image_nocomposite points_to_pixels strip_math
- start_filter stop_filter
+ start_filter stop_filter draw_gouraud_triangle
+ draw_gouraud_triangles
""".split()
def _set_current_renderer(self, renderer):
self._renderer = renderer
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2009-08-31 20:10:35 UTC (rev 7621)
@@ -17,6 +17,7 @@
from cStringIO import StringIO
from datetime import datetime
from math import ceil, cos, floor, pi, sin
+import struct
try:
set
except NameError:
@@ -268,7 +269,7 @@
gsave='q', grestore='Q',
textpos='Td', selectfont='Tf', textmatrix='Tm',
show='Tj', showkern='TJ',
- setlinewidth='w', clip='W')
+ setlinewidth='w', clip='W', shading='sh')
Op = Bunch(**dict([(name, Operator(value))
for name, value in _pdfops.items()]))
@@ -377,6 +378,7 @@
self.fontObject = self.reserveObject('fonts')
self.alphaStateObject = self.reserveObject('extended graphics states')
self.hatchObject = self.reserveObject('tiling patterns')
+ self.gouraudObject = self.reserveObject('Gouraud triangles')
self.XObjectObject = self.reserveObject('external objects')
self.resourceObject = self.reserveObject('resources')
@@ -403,6 +405,7 @@
self.nextAlphaState = 1
self.hatchPatterns = {}
self.nextHatch = 1
+ self.gouraudTriangles = []
self.images = {}
self.nextImage = 1
@@ -421,6 +424,7 @@
'XObject': self.XObjectObject,
'ExtGState': self.alphaStateObject,
'Pattern': self.hatchObject,
+ 'Shading': self.gouraudObject,
'ProcSet': procsets }
self.writeObject(self.resourceObject, resources)
@@ -452,6 +456,7 @@
dict([(val[0], val[1])
for val in self.alphaStates.values()]))
self.writeHatches()
+ self.writeGouraudTriangles()
xobjects = dict(self.images.values())
for tup in self.markers.values():
xobjects[tup[0]] = tup[1]
@@ -1050,6 +1055,44 @@
self.endStream()
self.writeObject(self.hatchObject, hatchDict)
+ def addGouraudTriangles(self, points, colors):
+ name = Name('GT%d' % len(self.gouraudTriangles))
+ self.gouraudTriangles.append((name, points, colors))
+ return name
+
+ def writeGouraudTriangles(self):
+ gouraudDict = dict()
+ for name, points, colors in self.gouraudTriangles:
+ ob = self.reserveObject('Gouraud triangle')
+ gouraudDict[name] = ob
+ shape = points.shape
+ flat_points = points.reshape((shape[0] * shape[1], 2))
+ points_min = npy.min(flat_points, axis=0) - (1 << 8)
+ points_max = npy.max(flat_points, axis=0) + (1 << 8)
+ factor = float(0xffffffff) / (points_max - points_min)
+ adjpoints = npy.array((points - points_min) * factor, dtype=npy.uint32)
+ adjcolors = npy.array(colors * 255.0, dtype=npy.uint8)
+
+ self.beginStream(
+ ob.id, None,
+ { 'ShadingType': 4,
+ 'BitsPerCoordinate': 32,
+ 'BitsPerComponent': 8,
+ 'BitsPerFlag': 8,
+ 'ColorSpace': Name('DeviceRGB'),
+ 'AntiAlias': 1,
+ 'Decode': [points_min[0], points_max[0],
+ points_min[1], points_max[1],
+ 0, 1, 0, 1, 0, 1]
+ })
+
+ for tpoints, tcolors in zip(adjpoints, adjcolors):
+ for p, c in zip(tpoints, tcolors):
+ values = [int(x) for x in [0] + list(p) + list(c[:3])]
+ self.write(struct.pack('>BLLBBB', *values))
+ self.endStream()
+ self.writeObject(self.gouraudObject, gouraudDict)
+
def imageObject(self, image):
"""Return name of an image XObject representing the given image."""
@@ -1326,6 +1369,18 @@
lastx, lasty = x, y
output(Op.grestore)
+ def draw_gouraud_triangle(self, gc, points, colors, trans):
+ self.draw_gouraud_triangles(gc, points.reshape((1, 3, 2)),
+ colors.reshape((1, 3, 4)), trans)
+
+ def draw_gouraud_triangles(self, gc, points, colors, trans):
+ shape = points.shape
+ points = points.reshape((shape[0] * shape[1], 2))
+ tpoints = trans.transform(points)
+ tpoints = tpoints.reshape(shape)
+ name = self.file.addGouraudTriangles(tpoints, colors)
+ self.file.output(name, Op.shading)
+
def _setup_textpos(self, x, y, descent, angle, oldx=0, oldy=0, olddescent=0, oldangle=0):
if angle == oldangle == 0:
self.file.output(x - oldx, (y + descent) - (oldy + olddescent), Op.textpos)
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2009-08-31 20:10:35 UTC (rev 7621)
@@ -1217,8 +1217,7 @@
triangles, colors = self.convert_mesh_to_triangles(
self._meshWidth, self._meshHeight, coordinates)
check = {}
- for tri, col in zip(triangles, colors):
- renderer.draw_gouraud_triangle(gc, tri, col, transform.frozen())
+ renderer.draw_gouraud_triangles(gc, triangles, colors, transform.frozen())
else:
renderer.draw_quad_mesh(
gc, transform.frozen(), self._meshWidth, self._meshHeight,
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/src/_backend_agg.cpp 2009-08-31 20:10:35 UTC (rev 7621)
@@ -1455,21 +1455,14 @@
return Py::Object();
}
-Py::Object
-RendererAgg::draw_gouraud_triangle(const Py::Tuple& args) {
- _VERBOSE("RendererAgg::draw_quad_mesh");
- args.verify_length(4);
+void
+RendererAgg::_draw_gouraud_triangle(const GCAgg& gc,
+ const double* points, const double* colors, agg::trans_affine trans) {
typedef agg::rgba8 color_t;
typedef agg::span_gouraud_rgba<color_t> span_gen_t;
typedef agg::span_allocator<color_t> span_alloc_t;
- //segments, trans, clipbox, colors, linewidths, antialiaseds
- GCAgg gc(args[0], dpi);
- Py::Object points_obj = args[1];
- Py::Object colors_obj = args[2];
- agg::trans_affine trans = py_to_agg_transformation_matrix(args[3].ptr());
-
theRasterizer.reset_clipping();
rendererBase.reset_clipping(true);
set_clipbox(gc.cliprect, theRasterizer);
@@ -1477,6 +1470,43 @@
trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_translation(0.0, (double)height);
+ double tpoints[6];
+
+ for (int i = 0; i < 6; i += 2) {
+ tpoints[i] = points[i];
+ tpoints[i+1] = points[i+1];
+ trans.transform(&tpoints[i], &tpoints[i+1]);
+ }
+
+ span_alloc_t span_alloc;
+ span_gen_t span_gen;
+
+ span_gen.colors(
+ agg::rgba(colors[0], colors[1], colors[2], colors[3]),
+ agg::rgba(colors[4], colors[5], colors[6], colors[7]),
+ agg::rgba(colors[8], colors[9], colors[10], colors[11]));
+ span_gen.triangle(
+ tpoints[0], tpoints[1],
+ tpoints[2], tpoints[3],
+ tpoints[4], tpoints[5],
+ 0.5);
+
+ theRasterizer.add_path(span_gen);
+ agg::render_scanlines_aa(
+ theRasterizer, slineP8, rendererBase, span_alloc, span_gen);
+}
+
+Py::Object
+RendererAgg::draw_gouraud_triangle(const Py::Tuple& args) {
+ _VERBOSE("RendererAgg::draw_gouraud_triangle");
+ args.verify_length(4);
+
+ //segments, trans, clipbox, colors, linewidths, antialiaseds
+ GCAgg gc(args[0], dpi);
+ Py::Object points_obj = args[1];
+ Py::Object colors_obj = args[2];
+ agg::trans_affine trans = py_to_agg_transformation_matrix(args[3].ptr());
+
PyArrayObject* points = (PyArrayObject*)PyArray_ContiguousFromAny
(points_obj.ptr(), PyArray_DOUBLE, 2, 2);
if (!points ||
@@ -1490,32 +1520,57 @@
throw Py::ValueError("colors must be a 3x4 numpy array");
try {
- double* opoints = (double*)PyArray_DATA(points);
- double* c = (double*)PyArray_DATA(colors);
- double tpoints[6];
+ _draw_gouraud_triangle(
+ gc, (double*)PyArray_DATA(points), (double*)PyArray_DATA(colors), trans);
+ } catch (...) {
+ Py_DECREF(points);
+ Py_DECREF(colors);
- for (int i = 0; i < 6; i += 2) {
- tpoints[i] = opoints[i];
- tpoints[i+1] = opoints[i+1];
- trans.transform(&tpoints[i], &tpoints[i+1]);
- }
+ throw;
+ }
- span_alloc_t span_alloc;
- span_gen_t span_gen;
+ Py_DECREF(points);
+ Py_DECREF(colors);
- span_gen.colors(
- agg::rgba(c[0], c[1], c[2], c[3]),
- agg::rgba(c[4], c[5], c[6], c[7]),
- agg::rgba(c[8], c[9], c[10], c[11]));
- span_gen.triangle(
- tpoints[0], tpoints[1],
- tpoints[2], tpoints[3],
- tpoints[4], tpoints[5],
- 0.5);
+ return Py::Object();
+}
- theRasterizer.add_path(span_gen);
- agg::render_scanlines_aa(
- theRasterizer, slineP8, rendererBase, span_alloc, span_gen);
+Py::Object
+RendererAgg::draw_gouraud_triangles(const Py::Tuple& args) {
+ _VERBOSE("RendererAgg::draw_gouraud_triangles");
+ args.verify_length(4);
+
+ typedef agg::rgba8 color_t;
+ typedef agg::span_gouraud_rgba<color_t> span_gen_t;
+ typedef agg::span_allocator<color_t> span_alloc_t;
+
+ //segments, trans, clipbox, colors, linewidths, antialiaseds
+ GCAgg gc(args[0], dpi);
+ Py::Object points_obj = args[1];
+ Py::Object colors_obj = args[2];
+ agg::trans_affine trans = py_to_agg_transformation_matrix(args[3].ptr());
+
+ PyArrayObject* points = (PyArrayObject*)PyArray_ContiguousFromAny
+ (points_obj.ptr(), PyArray_DOUBLE, 3, 3);
+ if (!points ||
+ PyArray_DIM(points, 1) != 3 || PyArray_DIM(points, 2) != 2)
+ throw Py::ValueError("points must be a Nx3x2 numpy array");
+
+ PyArrayObject* colors = (PyArrayObject*)PyArray_ContiguousFromAny
+ (colors_obj.ptr(), PyArray_DOUBLE, 3, 3);
+ if (!colors ||
+ PyArray_DIM(colors, 1) != 3 || PyArray_DIM(colors, 2) != 4)
+ throw Py::ValueError("colors must be a Nx3x4 numpy array");
+
+ if (PyArray_DIM(points, 0) != PyArray_DIM(colors, 0)) {
+ throw Py::ValueError("points and colors arrays must be the same length");
+ }
+
+ try {
+ for (int i = 0; i < PyArray_DIM(points, 0); ++i) {
+ _draw_gouraud_triangle(
+ gc, (double*)PyArray_GETPTR1(points, i), (double*)PyArray_GETPTR1(colors, i), trans);
+ }
} catch (...) {
Py_DECREF(points);
Py_DECREF(colors);
@@ -1870,6 +1925,8 @@
"draw_quad_mesh(gc, master_transform, meshWidth, meshHeight, coordinates, offsets, offsetTrans, facecolors, antialiaseds, showedges)\n");
add_varargs_method("draw_gouraud_triangle", &RendererAgg::draw_gouraud_triangle,
"draw_gouraud_triangle(gc, points, colors, master_transform)\n");
+ add_varargs_method("draw_gouraud_triangles", &RendererAgg::draw_gouraud_triangles,
+ "draw_gouraud_triangles(gc, points, colors, master_transform)\n");
add_varargs_method("draw_markers", &RendererAgg::draw_markers,
"draw_markers(gc, marker_path, marker_trans, path, rgbFace)\n");
add_varargs_method("draw_text_image", &RendererAgg::draw_text_image,
Modified: trunk/matplotlib/src/_backend_agg.h
===================================================================
--- trunk/matplotlib/src/_backend_agg.h 2009-08-31 19:50:13 UTC (rev 7620)
+++ trunk/matplotlib/src/_backend_agg.h 2009-08-31 20:10:35 UTC (rev 7621)
@@ -165,6 +165,7 @@
Py::Object draw_path_collection(const Py::Tuple & args);
Py::Object draw_quad_mesh(const Py::Tuple& args);
Py::Object draw_gouraud_triangle(const Py::Tuple& args);
+ Py::Object draw_gouraud_triangles(const Py::Tuple& args);
Py::Object write_rgba(const Py::Tuple & args);
Py::Object tostring_rgb(const Py::Tuple & args);
@@ -241,6 +242,11 @@
const Py::SeqBase<Py::Object>& linestyles_obj,
const Py::SeqBase<Py::Int>& antialiaseds);
+ void
+ _draw_gouraud_triangle(
+ const GCAgg& gc,
+ const double* points, const double* colors, agg::trans_affine trans);
+
private:
void create_alpha_buffers();
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2009-08-31 19:50:24
|
Revision: 7620
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7620&view=rev
Author: heeres
Date: 2009-08-31 19:50:13 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Colormap work:
- Simplify data for existing colormaps
- Add a few colormaps
- Allow setting of gamma
- Allow using functions
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/_cm.py
trunk/matplotlib/lib/matplotlib/cm.py
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/_cm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/_cm.py 2009-08-31 17:42:37 UTC (rev 7619)
+++ trunk/matplotlib/lib/matplotlib/_cm.py 2009-08-31 19:50:13 UTC (rev 7620)
@@ -4,6 +4,8 @@
"""
+import numpy as np
+
_binary_data = {
'red' : ((0., 1., 1.), (1., 0., 0.)),
'green': ((0., 1., 1.), (1., 0., 0.)),
@@ -32,96 +34,115 @@
'green': ((0., 0., 0.),(1.0, 0.7812, 0.7812)),
'blue': ((0., 0., 0.),(1.0, 0.4975, 0.4975))}
-_flag_data = {'red': ((0., 1., 1.),(0.015873, 1.000000, 1.000000),
- (0.031746, 0.000000, 0.000000),(0.047619, 0.000000, 0.000000),
- (0.063492, 1.000000, 1.000000),(0.079365, 1.000000, 1.000000),
- (0.095238, 0.000000, 0.000000),(0.111111, 0.000000, 0.000000),
- (0.126984, 1.000000, 1.000000),(0.142857, 1.000000, 1.000000),
- (0.158730, 0.000000, 0.000000),(0.174603, 0.000000, 0.000000),
- (0.190476, 1.000000, 1.000000),(0.206349, 1.000000, 1.000000),
- (0.222222, 0.000000, 0.000000),(0.238095, 0.000000, 0.000000),
- (0.253968, 1.000000, 1.000000),(0.269841, 1.000000, 1.000000),
- (0.285714, 0.000000, 0.000000),(0.301587, 0.000000, 0.000000),
- (0.317460, 1.000000, 1.000000),(0.333333, 1.000000, 1.000000),
- (0.349206, 0.000000, 0.000000),(0.365079, 0.000000, 0.000000),
- (0.380952, 1.000000, 1.000000),(0.396825, 1.000000, 1.000000),
- (0.412698, 0.000000, 0.000000),(0.428571, 0.000000, 0.000000),
- (0.444444, 1.000000, 1.000000),(0.460317, 1.000000, 1.000000),
- (0.476190, 0.000000, 0.000000),(0.492063, 0.000000, 0.000000),
- (0.507937, 1.000000, 1.000000),(0.523810, 1.000000, 1.000000),
- (0.539683, 0.000000, 0.000000),(0.555556, 0.000000, 0.000000),
- (0.571429, 1.000000, 1.000000),(0.587302, 1.000000, 1.000000),
- (0.603175, 0.000000, 0.000000),(0.619048, 0.000000, 0.000000),
- (0.634921, 1.000000, 1.000000),(0.650794, 1.000000, 1.000000),
- (0.666667, 0.000000, 0.000000),(0.682540, 0.000000, 0.000000),
- (0.698413, 1.000000, 1.000000),(0.714286, 1.000000, 1.000000),
- (0.730159, 0.000000, 0.000000),(0.746032, 0.000000, 0.000000),
- (0.761905, 1.000000, 1.000000),(0.777778, 1.000000, 1.000000),
- (0.793651, 0.000000, 0.000000),(0.809524, 0.000000, 0.000000),
- (0.825397, 1.000000, 1.000000),(0.841270, 1.000000, 1.000000),
- (0.857143, 0.000000, 0.000000),(0.873016, 0.000000, 0.000000),
- (0.888889, 1.000000, 1.000000),(0.904762, 1.000000, 1.000000),
- (0.920635, 0.000000, 0.000000),(0.936508, 0.000000, 0.000000),
- (0.952381, 1.000000, 1.000000),(0.968254, 1.000000, 1.000000),
- (0.984127, 0.000000, 0.000000),(1.0, 0., 0.)),
- 'green': ((0., 0., 0.),(0.015873, 1.000000, 1.000000),
- (0.031746, 0.000000, 0.000000),(0.063492, 0.000000, 0.000000),
- (0.079365, 1.000000, 1.000000),(0.095238, 0.000000, 0.000000),
- (0.126984, 0.000000, 0.000000),(0.142857, 1.000000, 1.000000),
- (0.158730, 0.000000, 0.000000),(0.190476, 0.000000, 0.000000),
- (0.206349, 1.000000, 1.000000),(0.222222, 0.000000, 0.000000),
- (0.253968, 0.000000, 0.000000),(0.269841, 1.000000, 1.000000),
- (0.285714, 0.000000, 0.000000),(0.317460, 0.000000, 0.000000),
- (0.333333, 1.000000, 1.000000),(0.349206, 0.000000, 0.000000),
- (0.380952, 0.000000, 0.000000),(0.396825, 1.000000, 1.000000),
- (0.412698, 0.000000, 0.000000),(0.444444, 0.000000, 0.000000),
- (0.460317, 1.000000, 1.000000),(0.476190, 0.000000, 0.000000),
- (0.507937, 0.000000, 0.000000),(0.523810, 1.000000, 1.000000),
- (0.539683, 0.000000, 0.000000),(0.571429, 0.000000, 0.000000),
- (0.587302, 1.000000, 1.000000),(0.603175, 0.000000, 0.000000),
- (0.634921, 0.000000, 0.000000),(0.650794, 1.000000, 1.000000),
- (0.666667, 0.000000, 0.000000),(0.698413, 0.000000, 0.000000),
- (0.714286, 1.000000, 1.000000),(0.730159, 0.000000, 0.000000),
- (0.761905, 0.000000, 0.000000),(0.777778, 1.000000, 1.000000),
- (0.793651, 0.000000, 0.000000),(0.825397, 0.000000, 0.000000),
- (0.841270, 1.000000, 1.000000),(0.857143, 0.000000, 0.000000),
- (0.888889, 0.000000, 0.000000),(0.904762, 1.000000, 1.000000),
- (0.920635, 0.000000, 0.000000),(0.952381, 0.000000, 0.000000),
- (0.968254, 1.000000, 1.000000),(0.984127, 0.000000, 0.000000),
- (1.0, 0., 0.)),
- 'blue': ((0., 0., 0.),(0.015873, 1.000000, 1.000000),
- (0.031746, 1.000000, 1.000000),(0.047619, 0.000000, 0.000000),
- (0.063492, 0.000000, 0.000000),(0.079365, 1.000000, 1.000000),
- (0.095238, 1.000000, 1.000000),(0.111111, 0.000000, 0.000000),
- (0.126984, 0.000000, 0.000000),(0.142857, 1.000000, 1.000000),
- (0.158730, 1.000000, 1.000000),(0.174603, 0.000000, 0.000000),
- (0.190476, 0.000000, 0.000000),(0.206349, 1.000000, 1.000000),
- (0.222222, 1.000000, 1.000000),(0.238095, 0.000000, 0.000000),
- (0.253968, 0.000000, 0.000000),(0.269841, 1.000000, 1.000000),
- (0.285714, 1.000000, 1.000000),(0.301587, 0.000000, 0.000000),
- (0.317460, 0.000000, 0.000000),(0.333333, 1.000000, 1.000000),
- (0.349206, 1.000000, 1.000000),(0.365079, 0.000000, 0.000000),
- (0.380952, 0.000000, 0.000000),(0.396825, 1.000000, 1.000000),
- (0.412698, 1.000000, 1.000000),(0.428571, 0.000000, 0.000000),
- (0.444444, 0.000000, 0.000000),(0.460317, 1.000000, 1.000000),
- (0.476190, 1.000000, 1.000000),(0.492063, 0.000000, 0.000000),
- (0.507937, 0.000000, 0.000000),(0.523810, 1.000000, 1.000000),
- (0.539683, 1.000000, 1.000000),(0.555556, 0.000000, 0.000000),
- (0.571429, 0.000000, 0.000000),(0.587302, 1.000000, 1.000000),
- (0.603175, 1.000000, 1.000000),(0.619048, 0.000000, 0.000000),
- (0.634921, 0.000000, 0.000000),(0.650794, 1.000000, 1.000000),
- (0.666667, 1.000000, 1.000000),(0.682540, 0.000000, 0.000000),
- (0.698413, 0.000000, 0.000000),(0.714286, 1.000000, 1.000000),
- (0.730159, 1.000000, 1.000000),(0.746032, 0.000000, 0.000000),
- (0.761905, 0.000000, 0.000000),(0.777778, 1.000000, 1.000000),
- (0.793651, 1.000000, 1.000000),(0.809524, 0.000000, 0.000000),
- (0.825397, 0.000000, 0.000000),(0.841270, 1.000000, 1.000000),
- (0.857143, 1.000000, 1.000000),(0.873016, 0.000000, 0.000000),
- (0.888889, 0.000000, 0.000000),(0.904762, 1.000000, 1.000000),
- (0.920635, 1.000000, 1.000000),(0.936508, 0.000000, 0.000000),
- (0.952381, 0.000000, 0.000000),(0.968254, 1.000000, 1.000000),
- (0.984127, 1.000000, 1.000000),(1.0, 0., 0.))}
+_flag_data = {
+ 'red': lambda x: 0.75 * np.sin((x * 31.5 + 0.25) * np.pi) + 0.5,
+ 'green': lambda x: np.sin(x * 31.5 * np.pi),
+ 'blue': lambda x: 0.75 * np.sin((x * 31.5 - 0.25) * np.pi) + 0.5,
+}
+_prism_data = {
+ 'red': lambda x: 0.75 * np.sin((x * 20.9 + 0.25) * np.pi) + 0.67,
+ 'green': lambda x: 0.75 * np.sin((x * 20.9 - 0.25) * np.pi) + 0.33,
+ 'blue': lambda x: -1.1 * np.sin((x * 20.9) * np.pi),
+}
+
+_bwr_data = ((0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0))
+_brg_data = ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0))
+
+# Gnuplot palette functions
+gfunc = {
+ 0: lambda x: 0,
+ 1: lambda x: 0.5,
+ 2: lambda x: 1,
+ 3: lambda x: x,
+ 4: lambda x: x**2,
+ 5: lambda x: x**3,
+ 6: lambda x: x**4,
+ 7: lambda x: np.sqrt(x),
+ 8: lambda x: np.sqrt(np.sqrt(x)),
+ 9: lambda x: np.sin(x * np.pi / 2),
+ 10: lambda x: np.cos(x * np.pi / 2),
+ 11: lambda x: np.abs(x - 0.5),
+ 12: lambda x: (2 * x - 1)**2,
+ 13: lambda x: np.sin(x * np.pi),
+ 14: lambda x: np.abs(np.cos(x * np.pi)),
+ 15: lambda x: np.sin(x * 2 * np.pi),
+ 16: lambda x: np.cos(x * 2 * np.pi),
+ 17: lambda x: np.abs(np.sin(x * 2 * np.pi)),
+ 18: lambda x: np.abs(np.cos(x * 2 * np.pi)),
+ 19: lambda x: np.abs(np.sin(x * 4 * np.pi)),
+ 20: lambda x: np.abs(np.cos(x * 4 * np.pi)),
+ 21: lambda x: 3 * x,
+ 22: lambda x: 3 * x - 1,
+ 23: lambda x: 3 * x - 2,
+ 24: lambda x: np.abs(3 * x - 1),
+ 25: lambda x: np.abs(3 * x - 2),
+ 26: lambda x: (3 * x - 1) / 2,
+ 27: lambda x: (3 * x - 2) / 2,
+ 28: lambda x: np.abs((3 * x - 1) / 2),
+ 29: lambda x: np.abs((3 * x - 2) / 2),
+ 30: lambda x: x / 0.32 - 0.78125,
+ 31: lambda x: 2 * x - 0.84,
+ 32: lambda x: gfunc32(x),
+ 33: lambda x: np.abs(2 * x - 0.5),
+ 34: lambda x: 2 * x,
+ 35: lambda x: 2 * x - 0.5,
+ 36: lambda x: 2 * x - 1.
+}
+
+def gfunc32(x):
+ ret = np.zeros(len(x))
+ m = (x < 0.25)
+ ret[m] = 4 * x[m]
+ m = (x >= 0.25) & (x < 0.92)
+ ret[m] = -2 * x[m] + 1.84
+ m = (x >= 0.92)
+ ret[m] = x[m] / 0.08 - 11.5
+ return ret
+
+_gnuplot_data = {
+ 'red': gfunc[7],
+ 'green': gfunc[5],
+ 'blue': gfunc[15],
+}
+
+_gnuplot2_data = {
+ 'red': gfunc[30],
+ 'green': gfunc[31],
+ 'blue': gfunc[32],
+}
+
+_ocean_data = {
+ 'red': gfunc[23],
+ 'green': gfunc[28],
+ 'blue': gfunc[3],
+}
+
+_afmhot_data = {
+ 'red': gfunc[34],
+ 'green': gfunc[35],
+ 'blue': gfunc[36],
+}
+
+_rainbow_data = {
+ 'red': gfunc[33],
+ 'green': gfunc[13],
+ 'blue': gfunc[10],
+}
+
+_seismic_data = (
+ (0.0, 0.0, 0.3), (0.0, 0.0, 1.0),
+ (1.0, 1.0, 1.0), (1.0, 0.0, 0.0),
+ (0.5, 0.0, 0.0))
+
+_terrain_data = (
+ (0.00, (0.2, 0.2, 0.6)),
+ (0.15, (0.0, 0.6, 1.0)),
+ (0.25, (0.0, 0.8, 0.4)),
+ (0.50, (1.0, 1.0, 0.6)),
+ (0.75, (0.5, 0.36, 0.33)),
+ (1.00, (1.0, 1.0, 1.0)))
+
_gray_data = {'red': ((0., 0, 0), (1., 1, 1)),
'green': ((0., 0, 0), (1., 1, 1)),
'blue': ((0., 0, 0), (1., 1, 1))}
@@ -249,77 +270,6 @@
(0.952381, 0.951711, 0.951711),(0.968254, 0.968075, 0.968075),
(0.984127, 0.984167, 0.984167),(1.0, 1.0, 1.0))}
-_prism_data = {'red': ((0., 1., 1.),(0.031746, 1.000000, 1.000000),
- (0.047619, 0.000000, 0.000000),(0.063492, 0.000000, 0.000000),
- (0.079365, 0.666667, 0.666667),(0.095238, 1.000000, 1.000000),
- (0.126984, 1.000000, 1.000000),(0.142857, 0.000000, 0.000000),
- (0.158730, 0.000000, 0.000000),(0.174603, 0.666667, 0.666667),
- (0.190476, 1.000000, 1.000000),(0.222222, 1.000000, 1.000000),
- (0.238095, 0.000000, 0.000000),(0.253968, 0.000000, 0.000000),
- (0.269841, 0.666667, 0.666667),(0.285714, 1.000000, 1.000000),
- (0.317460, 1.000000, 1.000000),(0.333333, 0.000000, 0.000000),
- (0.349206, 0.000000, 0.000000),(0.365079, 0.666667, 0.666667),
- (0.380952, 1.000000, 1.000000),(0.412698, 1.000000, 1.000000),
- (0.428571, 0.000000, 0.000000),(0.444444, 0.000000, 0.000000),
- (0.460317, 0.666667, 0.666667),(0.476190, 1.000000, 1.000000),
- (0.507937, 1.000000, 1.000000),(0.523810, 0.000000, 0.000000),
- (0.539683, 0.000000, 0.000000),(0.555556, 0.666667, 0.666667),
- (0.571429, 1.000000, 1.000000),(0.603175, 1.000000, 1.000000),
- (0.619048, 0.000000, 0.000000),(0.634921, 0.000000, 0.000000),
- (0.650794, 0.666667, 0.666667),(0.666667, 1.000000, 1.000000),
- (0.698413, 1.000000, 1.000000),(0.714286, 0.000000, 0.000000),
- (0.730159, 0.000000, 0.000000),(0.746032, 0.666667, 0.666667),
- (0.761905, 1.000000, 1.000000),(0.793651, 1.000000, 1.000000),
- (0.809524, 0.000000, 0.000000),(0.825397, 0.000000, 0.000000),
- (0.841270, 0.666667, 0.666667),(0.857143, 1.000000, 1.000000),
- (0.888889, 1.000000, 1.000000),(0.904762, 0.000000, 0.000000),
- (0.920635, 0.000000, 0.000000),(0.936508, 0.666667, 0.666667),
- (0.952381, 1.000000, 1.000000),(0.984127, 1.000000, 1.000000),
- (1.0, 0.0, 0.0)),
- 'green': ((0., 0., 0.),(0.031746, 1.000000, 1.000000),
- (0.047619, 1.000000, 1.000000),(0.063492, 0.000000, 0.000000),
- (0.095238, 0.000000, 0.000000),(0.126984, 1.000000, 1.000000),
- (0.142857, 1.000000, 1.000000),(0.158730, 0.000000, 0.000000),
- (0.190476, 0.000000, 0.000000),(0.222222, 1.000000, 1.000000),
- (0.238095, 1.000000, 1.000000),(0.253968, 0.000000, 0.000000),
- (0.285714, 0.000000, 0.000000),(0.317460, 1.000000, 1.000000),
- (0.333333, 1.000000, 1.000000),(0.349206, 0.000000, 0.000000),
- (0.380952, 0.000000, 0.000000),(0.412698, 1.000000, 1.000000),
- (0.428571, 1.000000, 1.000000),(0.444444, 0.000000, 0.000000),
- (0.476190, 0.000000, 0.000000),(0.507937, 1.000000, 1.000000),
- (0.523810, 1.000000, 1.000000),(0.539683, 0.000000, 0.000000),
- (0.571429, 0.000000, 0.000000),(0.603175, 1.000000, 1.000000),
- (0.619048, 1.000000, 1.000000),(0.634921, 0.000000, 0.000000),
- (0.666667, 0.000000, 0.000000),(0.698413, 1.000000, 1.000000),
- (0.714286, 1.000000, 1.000000),(0.730159, 0.000000, 0.000000),
- (0.761905, 0.000000, 0.000000),(0.793651, 1.000000, 1.000000),
- (0.809524, 1.000000, 1.000000),(0.825397, 0.000000, 0.000000),
- (0.857143, 0.000000, 0.000000),(0.888889, 1.000000, 1.000000),
- (0.904762, 1.000000, 1.000000),(0.920635, 0.000000, 0.000000),
- (0.952381, 0.000000, 0.000000),(0.984127, 1.000000, 1.000000),
- (1.0, 1.0, 1.0)),
- 'blue': ((0., 0., 0.),(0.047619, 0.000000, 0.000000),
- (0.063492, 1.000000, 1.000000),(0.079365, 1.000000, 1.000000),
- (0.095238, 0.000000, 0.000000),(0.142857, 0.000000, 0.000000),
- (0.158730, 1.000000, 1.000000),(0.174603, 1.000000, 1.000000),
- (0.190476, 0.000000, 0.000000),(0.238095, 0.000000, 0.000000),
- (0.253968, 1.000000, 1.000000),(0.269841, 1.000000, 1.000000),
- (0.285714, 0.000000, 0.000000),(0.333333, 0.000000, 0.000000),
- (0.349206, 1.000000, 1.000000),(0.365079, 1.000000, 1.000000),
- (0.380952, 0.000000, 0.000000),(0.428571, 0.000000, 0.000000),
- (0.444444, 1.000000, 1.000000),(0.460317, 1.000000, 1.000000),
- (0.476190, 0.000000, 0.000000),(0.523810, 0.000000, 0.000000),
- (0.539683, 1.000000, 1.000000),(0.555556, 1.000000, 1.000000),
- (0.571429, 0.000000, 0.000000),(0.619048, 0.000000, 0.000000),
- (0.634921, 1.000000, 1.000000),(0.650794, 1.000000, 1.000000),
- (0.666667, 0.000000, 0.000000),(0.714286, 0.000000, 0.000000),
- (0.730159, 1.000000, 1.000000),(0.746032, 1.000000, 1.000000),
- (0.761905, 0.000000, 0.000000),(0.809524, 0.000000, 0.000000),
- (0.825397, 1.000000, 1.000000),(0.841270, 1.000000, 1.000000),
- (0.857143, 0.000000, 0.000000),(0.904762, 0.000000, 0.000000),
- (0.920635, 1.000000, 1.000000),(0.936508, 1.000000, 1.000000),
- (0.952381, 0.000000, 0.000000),(1.0, 0.0, 0.0))}
-
_spring_data = {'red': ((0., 1., 1.),(1.0, 1.0, 1.0)),
'green': ((0., 0., 0.),(1.0, 1.0, 1.0)),
'blue': ((0., 1., 1.),(1.0, 0.0, 0.0))}
@@ -1470,4362 +1420,176 @@
# an evolution of the GIST package, both by David H. Munro.
# They are released under a BSD-like license (see LICENSE_YORICK in
# the license directory of the matplotlib source distribution).
-_gist_earth_data = {'blue': [(0.0, 0.0, 0.0), (0.0042016808874905109,
-0.18039216101169586, 0.18039216101169586), (0.0084033617749810219,
-0.22745098173618317, 0.22745098173618317), (0.012605042196810246,
-0.27058824896812439, 0.27058824896812439), (0.016806723549962044,
-0.31764706969261169, 0.31764706969261169), (0.021008403971791267,
-0.36078432202339172, 0.36078432202339172), (0.025210084393620491,
-0.40784314274787903, 0.40784314274787903), (0.029411764815449715,
-0.45490196347236633, 0.45490196347236633), (0.033613447099924088,
-0.45490196347236633, 0.45490196347236633), (0.037815127521753311,
-0.45490196347236633, 0.45490196347236633), (0.042016807943582535,
-0.45490196347236633, 0.45490196347236633), (0.046218488365411758,
-0.45490196347236633, 0.45490196347236633), (0.050420168787240982,
-0.45882353186607361, 0.45882353186607361), (0.054621849209070206,
-0.45882353186607361, 0.45882353186607361), (0.058823529630899429,
-0.45882353186607361, 0.45882353186607361), (0.063025213778018951,
-0.45882353186607361, 0.45882353186607361), (0.067226894199848175,
-0.45882353186607361, 0.45882353186607361), (0.071428574621677399,
-0.46274510025978088, 0.46274510025978088), (0.075630255043506622,
-0.46274510025978088, 0.46274510025978088), (0.079831935465335846,
-0.46274510025978088, 0.46274510025978088), (0.08403361588716507,
-0.46274510025978088, 0.46274510025978088), (0.088235296308994293,
-0.46274510025978088, 0.46274510025978088), (0.092436976730823517,
-0.46666666865348816, 0.46666666865348816), (0.09663865715265274,
-0.46666666865348816, 0.46666666865348816), (0.10084033757448196,
-0.46666666865348816, 0.46666666865348816), (0.10504201799631119,
-0.46666666865348816, 0.46666666865348816), (0.10924369841814041,
-0.46666666865348816, 0.46666666865348816), (0.11344537883996964,
-0.47058823704719543, 0.47058823704719543), (0.11764705926179886,
-0.47058823704719543, 0.47058823704719543), (0.12184873968362808,
-0.47058823704719543, 0.47058823704719543), (0.1260504275560379,
-0.47058823704719543, 0.47058823704719543), (0.13025210797786713,
-0.47058823704719543, 0.47058823704719543), (0.13445378839969635,
-0.47450980544090271, 0.47450980544090271), (0.13865546882152557,
-0.47450980544090271, 0.47450980544090271), (0.1428571492433548,
-0.47450980544090271, 0.47450980544090271), (0.14705882966518402,
-0.47450980544090271, 0.47450980544090271), (0.15126051008701324,
-0.47450980544090271, 0.47450980544090271), (0.15546219050884247,
-0.47843137383460999, 0.47843137383460999), (0.15966387093067169,
-0.47843137383460999, 0.47843137383460999), (0.16386555135250092,
-0.47843137383460999, 0.47843137383460999), (0.16806723177433014,
-0.47843137383460999, 0.47843137383460999), (0.17226891219615936,
-0.47843137383460999, 0.47843137383460999), (0.17647059261798859,
-0.48235294222831726, 0.48235294222831726), (0.18067227303981781,
-0.48235294222831726, 0.48235294222831726), (0.18487395346164703,
-0.48235294222831726, 0.48235294222831726), (0.18907563388347626,
-0.48235294222831726, 0.48235294222831726), (0.19327731430530548,
-0.48235294222831726, 0.48235294222831726), (0.1974789947271347,
-0.48627451062202454, 0.48627451062202454), (0.20168067514896393,
-0.48627451062202454, 0.48627451062202454), (0.20588235557079315,
-0.48627451062202454, 0.48627451062202454), (0.21008403599262238,
-0.48627451062202454, 0.48627451062202454), (0.2142857164144516,
-0.48627451062202454, 0.48627451062202454), (0.21848739683628082,
-0.49019607901573181, 0.49019607901573181), (0.22268907725811005,
-0.49019607901573181, 0.49019607901573181), (0.22689075767993927,
-0.49019607901573181, 0.49019607901573181), (0.23109243810176849,
-0.49019607901573181, 0.49019607901573181), (0.23529411852359772,
-0.49019607901573181, 0.49019607901573181), (0.23949579894542694,
-0.49411764740943909, 0.49411764740943909), (0.24369747936725616,
-0.49411764740943909, 0.49411764740943909), (0.24789915978908539,
-0.49411764740943909, 0.49411764740943909), (0.25210085511207581,
-0.49411764740943909, 0.49411764740943909), (0.25630253553390503,
-0.49411764740943909, 0.49411764740943909), (0.26050421595573425,
-0.49803921580314636, 0.49803921580314636), (0.26470589637756348,
-0.49803921580314636, 0.49803921580314636), (0.2689075767993927,
-0.49803921580314636, 0.49803921580314636), (0.27310925722122192,
-0.49803921580314636, 0.49803921580314636), (0.27731093764305115,
-0.49803921580314636, 0.49803921580314636), (0.28151261806488037,
-0.50196081399917603, 0.50196081399917603), (0.28571429848670959,
-0.49411764740943909, 0.49411764740943909), (0.28991597890853882,
-0.49019607901573181, 0.49019607901573181), (0.29411765933036804,
-0.48627451062202454, 0.48627451062202454), (0.29831933975219727,
-0.48235294222831726, 0.48235294222831726), (0.30252102017402649,
-0.47843137383460999, 0.47843137383460999), (0.30672270059585571,
-0.47058823704719543, 0.47058823704719543), (0.31092438101768494,
-0.46666666865348816, 0.46666666865348816), (0.31512606143951416,
-0.46274510025978088, 0.46274510025978088), (0.31932774186134338,
-0.45882353186607361, 0.45882353186607361), (0.32352942228317261,
-0.45098039507865906, 0.45098039507865906), (0.32773110270500183,
-0.44705882668495178, 0.44705882668495178), (0.33193278312683105,
-0.44313725829124451, 0.44313725829124451), (0.33613446354866028,
-0.43529412150382996, 0.43529412150382996), (0.3403361439704895,
-0.43137255311012268, 0.43137255311012268), (0.34453782439231873,
-0.42745098471641541, 0.42745098471641541), (0.34873950481414795,
-0.42352941632270813, 0.42352941632270813), (0.35294118523597717,
-0.41568627953529358, 0.41568627953529358), (0.3571428656578064,
-0.4117647111415863, 0.4117647111415863), (0.36134454607963562,
-0.40784314274787903, 0.40784314274787903), (0.36554622650146484,
-0.40000000596046448, 0.40000000596046448), (0.36974790692329407,
-0.3960784375667572, 0.3960784375667572), (0.37394958734512329,
-0.39215686917304993, 0.39215686917304993), (0.37815126776695251,
-0.38431373238563538, 0.38431373238563538), (0.38235294818878174,
-0.3803921639919281, 0.3803921639919281), (0.38655462861061096,
-0.37647059559822083, 0.37647059559822083), (0.39075630903244019,
-0.36862745881080627, 0.36862745881080627), (0.39495798945426941,
-0.364705890417099, 0.364705890417099), (0.39915966987609863,
-0.36078432202339172, 0.36078432202339172), (0.40336135029792786,
-0.35294118523597717, 0.35294118523597717), (0.40756303071975708,
-0.3490196168422699, 0.3490196168422699), (0.4117647111415863,
-0.34509804844856262, 0.34509804844856262), (0.41596639156341553,
-0.33725491166114807, 0.33725491166114807), (0.42016807198524475,
-0.3333333432674408, 0.3333333432674408), (0.42436975240707397,
-0.32941177487373352, 0.32941177487373352), (0.4285714328289032,
-0.32156863808631897, 0.32156863808631897), (0.43277311325073242,
-0.31764706969261169, 0.31764706969261169), (0.43697479367256165,
-0.31372550129890442, 0.31372550129890442), (0.44117647409439087,
-0.30588236451148987, 0.30588236451148987), (0.44537815451622009,
-0.30196079611778259, 0.30196079611778259), (0.44957983493804932,
-0.29803922772407532, 0.29803922772407532), (0.45378151535987854,
-0.29019609093666077, 0.29019609093666077), (0.45798319578170776,
-0.28627452254295349, 0.28627452254295349), (0.46218487620353699,
-0.27843138575553894, 0.27843138575553894), (0.46638655662536621,
-0.27450981736183167, 0.27450981736183167), (0.47058823704719543,
-0.27843138575553894, 0.27843138575553894), (0.47478991746902466,
-0.28235295414924622, 0.28235295414924622), (0.47899159789085388,
-0.28235295414924622, 0.28235295414924622), (0.48319327831268311,
-0.28627452254295349, 0.28627452254295349), (0.48739495873451233,
-0.28627452254295349, 0.28627452254295349), (0.49159663915634155,
-0.29019609093666077, 0.29019609093666077), (0.49579831957817078,
-0.29411765933036804, 0.29411765933036804), (0.5, 0.29411765933036804,
-0.29411765933036804), (0.50420171022415161, 0.29803922772407532,
-0.29803922772407532), (0.50840336084365845, 0.29803922772407532,
-0.29803922772407532), (0.51260507106781006, 0.30196079611778259,
-0.30196079611778259), (0.51680672168731689, 0.30196079611778259,
-0.30196079611778259), (0.52100843191146851, 0.30588236451148987,
-0.30588236451148987), (0.52521008253097534, 0.30980393290519714,
-0.30980393290519714), (0.52941179275512695, 0.30980393290519714,
-0.30980393290519714), (0.53361344337463379, 0.31372550129890442,
-0.31372550129890442), (0.5378151535987854, 0.31372550129890442,
-0.31372550129890442), (0.54201680421829224, 0.31764706969261169,
-0.31764706969261169), (0.54621851444244385, 0.32156863808631897,
-0.32156863808631897), (0.55042016506195068, 0.32156863808631897,
-0.32156863808631897), (0.55462187528610229, 0.32156863808631897,
-0.32156863808631897), (0.55882352590560913, 0.32549020648002625,
-0.32549020648002625), (0.56302523612976074, 0.32549020648002625,
-0.32549020648002625), (0.56722688674926758, 0.32549020648002625,
-0.32549020648002625), (0.57142859697341919, 0.32941177487373352,
-0.32941177487373352), (0.57563024759292603, 0.32941177487373352,
-0.32941177487373352), (0.57983195781707764, 0.32941177487373352,
-0.32941177487373352), (0.58403360843658447, 0.3333333432674408,
-0.3333333432674408), (0.58823531866073608, 0.3333333432674408,
-0.3333333432674408), (0.59243696928024292, 0.3333333432674408,
-0.3333333432674408), (0.59663867950439453, 0.33725491166114807,
-0.33725491166114807), (0.60084033012390137, 0.33725491166114807,
-0.33725491166114807), (0.60504204034805298, 0.33725491166114807,
-0.33725491166114807), (0.60924369096755981, 0.34117648005485535,
-0.34117648005485535), (0.61344540119171143, 0.34117648005485535,
-0.34117648005485535), (0.61764705181121826, 0.34117648005485535,
-0.34117648005485535), (0.62184876203536987, 0.34509804844856262,
-0.34509804844856262), (0.62605041265487671, 0.34509804844856262,
-0.34509804844856262), (0.63025212287902832, 0.34509804844856262,
-0.34509804844856262), (0.63445377349853516, 0.3490196168422699,
-0.3490196168422699), (0.63865548372268677, 0.3490196168422699,
-0.3490196168422699), (0.6428571343421936, 0.3490196168422699,
-0.3490196168422699), (0.64705884456634521, 0.35294118523597717,
-0.35294118523597717), (0.65126049518585205, 0.35294118523597717,
-0.35294118523597717), (0.65546220541000366, 0.35294118523597717,
-0.35294118523597717), (0.6596638560295105, 0.35686275362968445,
-0.35686275362968445), (0.66386556625366211, 0.35686275362968445,
-0.35686275362968445), (0.66806721687316895, 0.35686275362968445,
-0.35686275362968445), (0.67226892709732056, 0.36078432202339172,
-0.36078432202339172), (0.67647057771682739, 0.36078432202339172,
-0.36078432202339172), (0.680672287940979, 0.36078432202339172,
-0.36078432202339172), (0.68487393856048584, 0.364705890417099,
-0.364705890417099), (0.68907564878463745, 0.364705890417099,
-0.364705890417099), (0.69327729940414429, 0.364705890417099,
-0.364705890417099), (0.6974790096282959, 0.36862745881080627,
-0.36862745881080627), (0.70168066024780273, 0.36862745881080627,
-0.36862745881080627), (0.70588237047195435, 0.36862745881080627,
-0.36862745881080627), (0.71008402109146118, 0.37254902720451355,
-0.37254902720451355), (0.71428573131561279, 0.37254902720451355,
-0.37254902720451355), (0.71848738193511963, 0.37254902720451355,
-0.37254902720451355), (0.72268909215927124, 0.37647059559822083,
-0.37647059559822083), (0.72689074277877808, 0.37647059559822083,
-0.37647059559822083), (0.73109245300292969, 0.3803921639919281,
-0.3803921639919281), (0.73529410362243652, 0.3803921639919281,
-0.3803921639919281), (0.73949581384658813, 0.3803921639919281,
-0.3803921639919281), (0.74369746446609497, 0.38431373238563538,
-0.38431373238563538), (0.74789917469024658, 0.38431373238563538,
-0.38431373238563538), (0.75210082530975342, 0.38431373238563538,
-0.38431373238563538), (0.75630253553390503, 0.38823530077934265,
-0.38823530077934265), (0.76050418615341187, 0.38823530077934265,
-0.38823530077934265), (0.76470589637756348, 0.38823530077934265,
-0.38823530077934265), (0.76890754699707031, 0.39215686917304993,
-0.39215686917304993), (0.77310925722122192, 0.39215686917304993,
-0.39215686917304993), (0.77731090784072876, 0.39215686917304993,
-0.39215686917304993), (0.78151261806488037, 0.3960784375667572,
-0.3960784375667572), (0.78571426868438721, 0.3960784375667572,
-0.3960784375667572), (0.78991597890853882, 0.40784314274787903,
-0.40784314274787903), (0.79411762952804565, 0.41568627953529358,
-0.41568627953529358), (0.79831933975219727, 0.42352941632270813,
-0.42352941632270813), (0.8025209903717041, 0.43529412150382996,
-0.43529412150382996), (0.80672270059585571, 0.44313725829124451,
-0.44313725829124451), (0.81092435121536255, 0.45490196347236633,
-0.45490196347236633), (0.81512606143951416, 0.46274510025978088,
-0.46274510025978088), (0.819327712059021, 0.47450980544090271,
-0.47450980544090271), (0.82352942228317261, 0.48235294222831726,
-0.48235294222831726), (0.82773107290267944, 0.49411764740943909,
-0.49411764740943909), (0.83193278312683105, 0.5058823823928833,
-0.5058823823928833), (0.83613443374633789, 0.51372551918029785,
-0.51372551918029785), (0.8403361439704895, 0.52549022436141968,
-0.52549022436141968), (0.84453779458999634, 0.5372549295425415,
-0.5372549295425415), (0.84873950481414795, 0.54509806632995605,
-0.54509806632995605), (0.85294115543365479, 0.55686277151107788,
-0.55686277151107788), (0.8571428656578064, 0.56862747669219971,
-0.56862747669219971), (0.86134451627731323, 0.58039218187332153,
-0.58039218187332153), (0.86554622650146484, 0.58823531866073608,
-0.58823531866073608), (0.86974787712097168, 0.60000002384185791,
-0.60000002384185791), (0.87394958734512329, 0.61176472902297974,
-0.61176472902297974), (0.87815123796463013, 0.62352943420410156,
-0.62352943420410156), (0.88235294818878174, 0.63529413938522339,
-0.63529413938522339), (0.88655459880828857, 0.64705884456634521,
-0.64705884456634521), (0.89075630903244019, 0.65882354974746704,
-0.65882354974746704), (0.89495795965194702, 0.66666668653488159,
-0.66666668653488159), (0.89915966987609863, 0.67843139171600342,
-0.67843139171600342), (0.90336132049560547, 0.69019609689712524,
-0.69019609689712524), (0.90756303071975708, 0.70196080207824707,
-0.70196080207824707), (0.91176468133926392, 0.7137255072593689,
-0.7137255072593689), (0.91596639156341553, 0.72549021244049072,
-0.72549021244049072), (0.92016804218292236, 0.74117648601531982,
-0.74117648601531982), (0.92436975240707397, 0.75294119119644165,
-0.75294119119644165), (0.92857140302658081, 0.76470589637756348,
-0.76470589637756348), (0.93277311325073242, 0.7764706015586853,
-0.7764706015586853), (0.93697476387023926, 0.78823530673980713,
-0.78823530673980713), (0.94117647409439087, 0.80000001192092896,
-0.80000001192092896), (0.94537812471389771, 0.81176471710205078,
-0.81176471710205078), (0.94957983493804932, 0.82745099067687988,
-0.82745099067687988), (0.95378148555755615, 0.83921569585800171,
-0.83921569585800171), (0.95798319578170776, 0.85098040103912354,
-0.85098040103912354), (0.9621848464012146, 0.86274510622024536,
-0.86274510622024536), (0.96638655662536621, 0.87843137979507446,
-0.87843137979507446), (0.97058820724487305, 0.89019608497619629,
-0.89019608497619629), (0.97478991746902466, 0.90196079015731812,
-0.90196079015731812), (0.97899156808853149, 0.91764706373214722,
-0.91764706373214722), (0.98319327831268311, 0.92941176891326904,
-0.92941176891326904), (0.98739492893218994, 0.94509804248809814,
-0.94509804248809814), (0.99159663915634155, 0.95686274766921997,
-0.95686274766921997), (0.99579828977584839, 0.97254902124404907,
-0.97254902124404907), (1.0, 0.9843137264251709, 0.9843137264251709)],
-'green': [(0.0, 0.0, 0.0), (0.0042016808874905109, 0.0, 0.0),
-(0.0084033617749810219, 0.0, 0.0), (0.012605042196810246, 0.0, 0.0),
-(0.016806723549962044, 0.0, 0.0), (0.021008403971791267, 0.0, 0.0),
-(0.025210084393620491, 0.0, 0.0), (0.029411764815449715, 0.0, 0.0),
-(0.033613447099924088, 0.011764706112444401, 0.011764706112444401),
-(0.037815127521753311, 0.023529412224888802, 0.023529412224888802),
-(0.042016807943582535, 0.031372550874948502, 0.031372550874948502),
-(0.046218488365411758, 0.043137256056070328, 0.043137256056070328),
-(0.050420168787240982, 0.050980392843484879, 0.050980392843484879),
-(0.054621849209070206, 0.062745101749897003, 0.062745101749897003),
-(0.058823529630899429, 0.070588238537311554, 0.070588238537311554),
-(0.063025213778018951, 0.08235294371843338, 0.08235294371843338),
-(0.067226894199848175, 0.090196080505847931, 0.090196080505847931),
-(0.071428574621677399, 0.10196078568696976, 0.10196078568696976),
-(0.075630255043506622, 0.10980392247438431, 0.10980392247438431),
-(0.079831935465335846, 0.12156862765550613, 0.12156862765550613),
-(0.08403361588716507, 0.12941177189350128, 0.12941177189350128),
-(0.088235296308994293, 0.14117647707462311, 0.14117647707462311),
-(0.092436976730823517, 0.14901961386203766, 0.14901961386203766),
-(0.09663865715265274, 0.16078431904315948, 0.16078431904315948),
-(0.10084033757448196, 0.16862745583057404, 0.16862745583057404),
-(0.10504201799631119, 0.17647059261798859, 0.17647059261798859),
-(0.10924369841814041, 0.18823529779911041, 0.18823529779911041),
-(0.11344537883996964, 0.19607843458652496, 0.19607843458652496),
-(0.11764705926179886, 0.20392157137393951, 0.20392157137393951),
-(0.12184873968362808, 0.21568627655506134, 0.21568627655506134),
-(0.1260504275560379, 0.22352941334247589, 0.22352941334247589),
-(0.13025210797786713, 0.23137255012989044, 0.23137255012989044),
-(0.13445378839969635, 0.23921568691730499, 0.23921568691730499),
-(0.13865546882152557, 0.25098040699958801, 0.25098040699958801),
-(0.1428571492433548, 0.25882354378700256, 0.25882354378700256),
-(0.14705882966518402, 0.26666668057441711, 0.26666668057441711),
-(0.15126051008701324, 0.27450981736183167, 0.27450981736183167),
-(0.15546219050884247, 0.28235295414924622, 0.28235295414924622),
-(0.15966387093067169, 0.29019609093666077, 0.29019609093666077),
-(0.16386555135250092, 0.30196079611778259, 0.30196079611778259),
-(0.16806723177433014, 0.30980393290519714, 0.30980393290519714),
-(0.17226891219615936, 0.31764706969261169, 0.31764706969261169),
-(0.17647059261798859, 0.32549020648002625, 0.32549020648002625),
-(0.18067227303981781, 0.3333333432674408, 0.3333333432674408),
-(0.18487395346164703, 0.34117648005485535, 0.34117648005485535),
-(0.18907563388347626, 0.3490196168422699, 0.3490196168422699),
-(0.19327731430530548, 0.35686275362968445, 0.35686275362968445),
-(0.1974789947271347, 0.364705890417099, 0.364705890417099),
-(0.20168067514896393, 0.37254902720451355, 0.37254902720451355),
-(0.20588235557079315, 0.3803921639919281, 0.3803921639919281),
-(0.21008403599262238, 0.38823530077934265, 0.38823530077934265),
-(0.2142857164144516, 0.39215686917304993, 0.39215686917304993),
-(0.21848739683628082, 0.40000000596046448, 0.40000000596046448),
-(0.22268907725811005, 0.40784314274787903, 0.40784314274787903),
-(0.22689075767993927, 0.41568627953529358, 0.41568627953529358),
-(0.23109243810176849, 0.42352941632270813, 0.42352941632270813),
-(0.23529411852359772, 0.42745098471641541, 0.42745098471641541),
-(0.23949579894542694, 0.43529412150382996, 0.43529412150382996),
-(0.24369747936725616, 0.44313725829124451, 0.44313725829124451),
-(0.24789915978908539, 0.45098039507865906, 0.45098039507865906),
-(0.25210085511207581, 0.45490196347236633, 0.45490196347236633),
-(0.25630253553390503, 0.46274510025978088, 0.46274510025978088),
-(0.26050421595573425, 0.47058823704719543, 0.47058823704719543),
-(0.26470589637756348, 0.47450980544090271, 0.47450980544090271),
-(0.2689075767993927, 0.48235294222831726, 0.48235294222831726),
-(0.27310925722122192, 0.49019607901573181, 0.49019607901573181),
-(0.27731093764305115, 0.49411764740943909, 0.49411764740943909),
-(0.28151261806488037, 0.50196081399917603, 0.50196081399917603),
-(0.28571429848670959, 0.50196081399917603, 0.50196081399917603),
-(0.28991597890853882, 0.5058823823928833, 0.5058823823928833),
-(0.29411765933036804, 0.5058823823928833, 0.5058823823928833),
-(0.29831933975219727, 0.50980395078659058, 0.50980395078659058),
-(0.30252102017402649, 0.51372551918029785, 0.51372551918029785),
-(0.30672270059585571, 0.51372551918029785, 0.51372551918029785),
-(0.31092438101768494, 0.51764708757400513, 0.51764708757400513),
-(0.31512606143951416, 0.5215686559677124, 0.5215686559677124),
-(0.31932774186134338, 0.5215686559677124, 0.5215686559677124),
-(0.32352942228317261, 0.52549022436141968, 0.52549022436141968),
-(0.32773110270500183, 0.52549022436141968, 0.52549022436141968),
-(0.33193278312683105, 0.52941179275512695, 0.52941179275512695),
-(0.33613446354866028, 0.53333336114883423, 0.53333336114883423),
-(0.3403361439704895, 0.53333336114883423, 0.53333336114883423),
-(0.34453782439231873, 0.5372549295425415, 0.5372549295425415),
-(0.34873950481414795, 0.54117649793624878, 0.54117649793624878),
-(0.35294118523597717, 0.54117649793624878, 0.54117649793624878),
-(0.3571428656578064, 0.54509806632995605, 0.54509806632995605),
-(0.36134454607963562, 0.54901963472366333, 0.54901963472366333),
-(0.36554622650146484, 0.54901963472366333, 0.54901963472366333),
-(0.36974790692329407, 0.55294120311737061, 0.55294120311737061),
-(0.37394958734512329, 0.55294120311737061, 0.55294120311737061),
-(0.37815126776695251, 0.55686277151107788, 0.55686277151107788),
-(0.38235294818878174, 0.56078433990478516, 0.56078433990478516),
-(0.38655462861061096, 0.56078433990478516, 0.56078433990478516),
-(0.39075630903244019, 0.56470590829849243, 0.56470590829849243),
-(0.39495798945426941, 0.56862747669219971, 0.56862747669219971),
-(0.39915966987609863, 0.56862747669219971, 0.56862747669219971),
-(0.40336135029792786, 0.57254904508590698, 0.57254904508590698),
-(0.40756303071975708, 0.57254904508590698, 0.57254904508590698),
-(0.4117647111415863, 0.57647061347961426, 0.57647061347961426),
-(0.41596639156341553, 0.58039218187332153, 0.58039218187332153),
-(0.42016807198524475, 0.58039218187332153, 0.58039218187332153),
-(0.42436975240707397, 0.58431375026702881, 0.58431375026702881),
-(0.4285714328289032, 0.58823531866073608, 0.58823531866073608),
-(0.43277311325073242, 0.58823531866073608, 0.58823531866073608),
-(0.43697479367256165, 0.59215688705444336, 0.59215688705444336),
-(0.44117647409439087, 0.59215688705444336, 0.59215688705444336),
-(0.44537815451622009, 0.59607845544815063, 0.59607845544815063),
-(0.44957983493804932, 0.60000002384185791, 0.60000002384185791),
-(0.45378151535987854, 0.60000002384185791, 0.60000002384185791),
-(0.45798319578170776, 0.60392159223556519, 0.60392159223556519),
-(0.46218487620353699, 0.60784316062927246, 0.60784316062927246),
-(0.46638655662536621, 0.60784316062927246, 0.60784316062927246),
-(0.47058823704719543, 0.61176472902297974, 0.61176472902297974),
-(0.47478991746902466, 0.61176472902297974, 0.61176472902297974),
-(0.47899159789085388, 0.61568629741668701, 0.61568629741668701),
-(0.48319327831268311, 0.61960786581039429, 0.61960786581039429),
-(0.48739495873451233, 0.61960786581039429, 0.61960786581039429),
-(0.49159663915634155, 0.62352943420410156, 0.62352943420410156),
-(0.49579831957817078, 0.62745100259780884, 0.62745100259780884), (0.5,
-0.62745100259780884, 0.62745100259780884), (0.50420171022415161,
-0.63137257099151611, 0.63137257099151611), (0.50840336084365845,
-0.63137257099151611, 0.63137257099151611), (0.51260507106781006,
-0.63529413938522339, 0.63529413938522339), (0.51680672168731689,
-0.63921570777893066, 0.63921570777893066), (0.52100843191146851,
-0.63921570777893066, 0.63921570777893066), (0.52521008253097534,
-0.64313727617263794, 0.64313727617263794), (0.52941179275512695,
-0.64705884456634521, 0.64705884456634521), (0.53361344337463379,
-0.64705884456634521, 0.64705884456634521), (0.5378151535987854,
-0.65098041296005249, 0.65098041296005249), (0.54201680421829224,
-0.65098041296005249, 0.65098041296005249), (0.54621851444244385,
-0.65490198135375977, 0.65490198135375977), (0.55042016506195068,
-0.65882354974746704, 0.65882354974746704), (0.55462187528610229,
-0.65882354974746704, 0.65882354974746704), (0.55882352590560913,
-0.65882354974746704, 0.65882354974746704), (0.56302523612976074,
-0.66274511814117432, 0.66274511814117432), (0.56722688674926758,
-0.66274511814117432, 0.66274511814117432), (0.57142859697341919,
-0.66666668653488159, 0.66666668653488159), (0.57563024759292603,
-0.66666668653488159, 0.66666668653488159), (0.57983195781707764,
-0.67058825492858887, 0.67058825492858887), (0.58403360843658447,
-0.67058825492858887, 0.67058825492858887), (0.58823531866073608,
-0.67450982332229614, 0.67450982332229614), (0.59243696928024292,
-0.67450982332229614, 0.67450982332229614), (0.59663867950439453,
-0.67450982332229614, 0.67450982332229614), (0.60084033012390137,
-0.67843139171600342, 0.67843139171600342), (0.60504204034805298,
-0.67843139171600342, 0.67843139171600342), (0.60924369096755981,
-0.68235296010971069, 0.68235296010971069), (0.61344540119171143,
-0.68235296010971069, 0.68235296010971069), (0.61764705181121826,
-0.68627452850341797, 0.68627452850341797), (0.62184876203536987,
-0.68627452850341797, 0.68627452850341797), (0.62605041265487671,
-0.68627452850341797, 0.68627452850341797), (0.63025212287902832,
-0.69019609689712524, 0.69019609689712524), (0.63445377349853516,
-0.69019609689712524, 0.69019609689712524), (0.63865548372268677,
-0.69411766529083252, 0.69411766529083252), (0.6428571343421936,
-0.69411766529083252, 0.69411766529083252), (0.64705884456634521,
-0.69803923368453979, 0.69803923368453979), (0.65126049518585205,
-0.69803923368453979, 0.69803923368453979), (0.65546220541000366,
-0.70196080207824707, 0.70196080207824707), (0.6596638560295105,
-0.70196080207824707, 0.70196080207824707), (0.66386556625366211,
-0.70196080207824707, 0.70196080207824707), (0.66806721687316895,
-0.70588237047195435, 0.70588237047195435), (0.67226892709732056,
-0.70588237047195435, 0.70588237047195435), (0.67647057771682739,
-0.70980393886566162, 0.70980393886566162), (0.680672287940979,
-0.70980393886566162, 0.70980393886566162), (0.68487393856048584,
-0.7137255072593689, 0.7137255072593689), (0.68907564878463745,
-0.7137255072593689, 0.7137255072593689), (0.69327729940414429,
-0.71764707565307617, 0.71764707565307617), (0.6974790096282959,
-0.71764707565307617, 0.71764707565307617), (0.70168066024780273,
-0.7137255072593689, 0.7137255072593689), (0.70588237047195435,
-0.70980393886566162, 0.70980393886566162), (0.71008402109146118,
-0.70980393886566162, 0.70980393886566162), (0.71428573131561279,
-0.70588237047195435, 0.70588237047195435), (0.71848738193511963,
-0.70196080207824707, 0.70196080207824707), (0.72268909215927124,
-0.69803923368453979, 0.69803923368453979), (0.72689074277877808,
-0.69411766529083252, 0.69411766529083252), (0.73109245300292969,
-0.69019609689712524, 0.69019609689712524), (0.73529410362243652,
-0.68627452850341797, 0.68627452850341797), (0.73949581384658813,
-0.68235296010971069, 0.68235296010971069), (0.74369746446609497,
-0.67843139171600342, 0.67843139171600342), (0.74789917469024658,
-0.67450982332229614, 0.67450982332229614), (0.75210082530975342,
-0.67058825492858887, 0.67058825492858887), (0.75630253553390503,
-0.66666668653488159, 0.66666668653488159), (0.76050418615341187,
-0.66274511814117432, 0.66274511814117432), (0.76470589637756348,
-0.65882354974746704, 0.65882354974746704), (0.76890754699707031,
-0.65490198135375977, 0.65490198135375977), (0.77310925722122192,
-0.65098041296005249, 0.65098041296005249), (0.77731090784072876,
-0.64705884456634521, 0.64705884456634521), (0.78151261806488037,
-0.64313727617263794, 0.64313727617263794), (0.78571426868438721,
-0.63921570777893066, 0.63921570777893066), (0.78991597890853882,
-0.63921570777893066, 0.63921570777893066), (0.79411762952804565,
-0.64313727617263794, 0.64313727617263794), (0.79831933975219727,
-0.64313727617263794, 0.64313727617263794), (0.8025209903717041,
-0.64705884456634521, 0.64705884456634521), (0.80672270059585571,
-0.64705884456634521, 0.64705884456634521), (0.81092435121536255,
-0.65098041296005249, 0.65098041296005249), (0.81512606143951416,
-0.65490198135375977, 0.65490198135375977), (0.819327712059021,
-0.65490198135375977, 0.65490198135375977), (0.82352942228317261,
-0.65882354974746704, 0.65882354974746704), (0.82773107290267944,
-0.66274511814117432, 0.66274511814117432), (0.83193278312683105,
-0.66666668653488159, 0.66666668653488159), (0.83613443374633789,
-0.67058825492858887, 0.67058825492858887), (0.8403361439704895,
-0.67450982332229614, 0.67450982332229614), (0.84453779458999634,
-0.67843139171600342, 0.67843139171600342), (0.84873950481414795,
-0.68235296010971069, 0.68235296010971069), (0.85294115543365479,
-0.68627452850341797, 0.68627452850341797), (0.8571428656578064,
-0.69019609689712524, 0.69019609689712524), (0.86134451627731323,
-0.69411766529083252, 0.69411766529083252), (0.86554622650146484,
-0.69803923368453979, 0.69803923368453979), (0.86974787712097168,
-0.70196080207824707, 0.70196080207824707), (0.87394958734512329,
-0.70980393886566162, 0.70980393886566162), (0.87815123796463013,
-0.7137255072593689, 0.7137255072593689), (0.88235294818878174,
-0.72156864404678345, 0.72156864404678345), (0.88655459880828857,
-0.72549021244049072, 0.72549021244049072), (0.89075630903244019,
-0.73333334922790527, 0.73333334922790527), (0.89495795965194702,
-0.73725491762161255, 0.73725491762161255), (0.89915966987609863,
-0.7450980544090271, 0.7450980544090271), (0.90336132049560547,
-0.75294119119644165, 0.75294119119644165), (0.90756303071975708,
-0.7607843279838562, 0.7607843279838562), (0.91176468133926392,
-0.76862746477127075, 0.76862746477127075), (0.91596639156341553,
-0.7764706015586853, 0.7764706015586853), (0.92016804218292236,
-0.78431373834609985, 0.78431373834609985), (0.92436975240707397,
-0.7921568751335144, 0.7921568751335144), (0.92857140302658081,
-0.80000001192092896, 0.80000001192092896), (0.93277311325073242,
-0.80784314870834351, 0.80784314870834351), (0.93697476387023926,
-0.81568628549575806, 0.81568628549575806), (0.94117647409439087,
-0.82745099067687988, 0.82745099067687988), (0.94537812471389771,
-0.83529412746429443, 0.83529412746429443), (0.94957983493804932,
-0.84313726425170898, 0.84313726425170898), (0.95378148555755615,
-0.85490196943283081, 0.85490196943283081), (0.95798319578170776,
-0.86666667461395264, 0.86666667461395264), (0.9621848464012146,
-0.87450981140136719, 0.87450981140136719), (0.96638655662536621,
-0.88627451658248901, 0.88627451658248901), (0.97058820724487305,
-0.89803922176361084, 0.89803922176361084), (0.97478991746902466,
-0.90980392694473267, 0.90980392694473267), (0.97899156808853149,
-0.92156863212585449, 0.92156863212585449), (0.98319327831268311,
-0.93333333730697632, 0.93333333730697632), (0.98739492893218994,
-0.94509804248809814, 0.94509804248809814), (0.99159663915634155,
-0.95686274766921997, 0.95686274766921997), (0.99579828977584839,
-0.97254902124404907, 0.97254902124404907), (1.0, 0.9843137264251709,
-0.9843137264251709)], 'red': [(0.0, 0.0, 0.0), (0.0042016808874905109,
-0.0, 0.0), (0.0084033617749810219, 0.0, 0.0), (0.012605042196810246, 0.0,
-0.0), (0.016806723549962044, 0.0, 0.0), (0.021008403971791267, 0.0, 0.0),
-(0.025210084393620491, 0.0, 0.0), (0.029411764815449715, 0.0, 0.0),
-(0.033613447099924088, 0.0, 0.0), (0.037815127521753311,
-0.0039215688593685627, 0.0039215688593685627), (0.042016807943582535,
-0.0078431377187371254, 0.0078431377187371254), (0.046218488365411758,
-0.0078431377187371254, 0.0078431377187371254), (0.050420168787240982,
-0.011764706112444401, 0.011764706112444401), (0.054621849209070206,
-0.015686275437474251, 0.015686275437474251), (0.058823529630899429,
-0.019607843831181526, 0.019607843831181526), (0.063025213778018951,
-0.019607843831181526, 0.019607843831181526), (0.067226894199848175,
-0.023529412224888802, 0.023529412224888802), (0.071428574621677399,
-0.027450980618596077, 0.027450980618596077), (0.075630255043506622,
-0.031372550874948502, 0.031372550874948502), (0.079831935465335846,
-0.031372550874948502, 0.031372550874948502), (0.08403361588716507,
-0.035294119268655777, 0.035294119268655777), (0.088235296308994293,
-0.039215687662363052, 0.039215687662363052), (0.092436976730823517,
-0.043137256056070328, 0.043137256056070328), (0.09663865715265274,
-0.043137256056070328, 0.043137256056070328), (0.10084033757448196,
-0.047058824449777603, 0.047058824449777603), (0.10504201799631119,
-0.050980392843484879, 0.050980392843484879), (0.10924369841814041,
-0.054901961237192154, 0.054901961237192154), (0.11344537883996964,
-0.058823529630899429, 0.058823529630899429), (0.11764705926179886,
-0.058823529630899429, 0.058823529630899429), (0.12184873968362808,
-0.062745101749897003, 0.062745101749897003), (0.1260504275560379,
-0.066666670143604279, 0.066666670143604279), (0.13025210797786713,
-0.070588238537311554, 0.070588238537311554), (0.13445378839969635,
-0.070588238537311554, 0.070588238537311554), (0.13865546882152557,
-0.074509806931018829, 0.074509806931018829), (0.1428571492433548,
-0.078431375324726105, 0.078431375324726105), (0.14705882966518402,
-0.08235294371843338, 0.08235294371843338), (0.15126051008701324,
-0.086274512112140656, 0.086274512112140656), (0.15546219050884247,
-0.086274512112140656, 0.086274512112140656), (0.15966387093067169,
-0.090196080505847931, 0.090196080505847931), (0.16386555135250092,
-0.094117648899555206, 0.094117648899555206), (0.16806723177433014,
-0.098039217293262482, 0.098039217293262482), (0.17226891219615936,
-0.10196078568696976, 0.10196078568696976), (0.17647059261798859,
-0.10196078568696976, 0.10196078568696976), (0.18067227303981781,
-0.10588235408067703, 0.10588235408067703), (0.18487395346164703,
-0.10980392247438431, 0.10980392247438431), (0.18907563388347626,
-0.11372549086809158, 0.11372549086809158), (0.19327731430530548,
-0.11764705926179886, 0.11764705926179886), (0.1974789947271347,
-0.12156862765550613, 0.12156862765550613), (0.20168067514896393,
-0.12156862765550613, 0.12156862765550613), (0.20588235557079315,
-0.12549020349979401, 0.12549020349979401), (0.21008403599262238,
-0.12941177189350128, 0.12941177189350128), (0.2142857164144516,
-0.13333334028720856, 0.13333334028720856), (0.21848739683628082,
-0.13725490868091583, 0.13725490868091583), (0.22268907725811005,
-0.14117647707462311, 0.14117647707462311), (0.22689075767993927,
-0.14117647707462311, 0.14117647707462311), (0.23109243810176849,
-0.14509804546833038, 0.14509804546833038), (0.23529411852359772,
-0.14901961386203766, 0.14901961386203766), (0.23949579894542694,
-0.15294118225574493, 0.15294118225574493), (0.24369747936725616,
-0.15686275064945221, 0.15686275064945221), (0.24789915978908539,
-0.16078431904315948, 0.16078431904315948), (0.25210085511207581,
-0.16078431904315948, 0.16078431904315948), (0.25630253553390503,
-0.16470588743686676, 0.16470588743686676), (0.26050421595573425,
-0.16862745583057404, 0.16862745583057404), (0.26470589637756348,
-0.17254902422428131, 0.17254902422428131), (0.2689075767993927,
-0.17647059261798859, 0.17647059261798859), (0.27310925722122192,
-0.18039216101169586, 0.18039216101169586), (0.27731093764305115,
-0.18431372940540314, 0.18431372940540314), (0.28151261806488037,
-0.18823529779911041, 0.18823529779911041), (0.28571429848670959,
-0.18823529779911041, 0.18823529779911041), (0.28991597890853882,
-0.18823529779911041, 0.18823529779911041), (0.29411765933036804,
-0.19215686619281769, 0.19215686619281769), (0.29831933975219727,
-0.19215686619281769, 0.19215686619281769), (0.30252102017402649,
-0.19607843458652496, 0.19607843458652496), (0.30672270059585571,
-0.19607843458652496, 0.19607843458652496), (0.31092438101768494,
-0.20000000298023224, 0.20000000298023224), (0.31512606143951416,
-0.20000000298023224, 0.20000000298023224), (0.31932774186134338,
-0.20392157137393951, 0.20392157137393951), (0.32352942228317261,
-0.20392157137393951, 0.20392157137393951), (0.32773110270500183,
-0.20784313976764679, 0.20784313976764679), (0.33193278312683105,
-0.20784313976764679, 0.20784313976764679), (0.33613446354866028,
-0.21176470816135406, 0.21176470816135406), (0.3403361439704895,
-0.21176470816135406, 0.21176470816135406), (0.34453782439231873,
-0.21568627655506134, 0.21568627655506134), (0.34873950481414795,
-0.21568627655506134, 0.21568627655506134), (0.35294118523597717,
-0.21960784494876862, 0.21960784494876862), (0.3571428656578064,
-0.21960784494876862, 0.21960784494876862), (0.36134454607963562,
-0.22352941334247589, 0.22352941334247589), (0.36554622650146484,
-0.22352941334247589, 0.22352941334247589), (0.36974790692329407,
-0.22745098173618317, 0.22745098173618317), (0.37394958734512329,
-0.22745098173618317, 0.22745098173618317), (0.37815126776695251,
-0.23137255012989044, 0.23137255012989044), (0.38235294818878174,
-0.23137255012989044, 0.23137255012989044), (0.38655462861061096,
-0.23529411852359772, 0.23529411852359772), (0.39075630903244019,
-0.23921568691730499, 0.23921568691730499), (0.39495798945426941,
-0.23921568691730499, 0.23921568691730499), (0.39915966987609863,
-0.24313725531101227, 0.24313725531101227), (0.40336135029792786,
-0.24313725531101227, 0.24313725531101227), (0.40756303071975708,
-0.24705882370471954, 0.24705882370471954), (0.4117647111415863,
-0.24705882370471954, 0.24705882370471954), (0.41596639156341553,
-0.25098040699958801, 0.25098040699958801), (0.42016807198524475,
-0.25098040699958801, 0.25098040699958801), (0.42436975240707397,
-0.25490197539329529, 0.25490197539329529), (0.4285714328289032,
-0.25490197539329529, 0.25490197539329529), (0.43277311325073242,
-0.25882354378700256, 0.25882354378700256), (0.43697479367256165,
-0.26274511218070984, 0.26274511218070984), (0.44117647409439087,
-0.26274511218070984, 0.26274511218070984), (0.44537815451622009,
-0.26666668057441711, 0.26666668057441711), (0.44957983493804932,
-0.26666668057441711, 0.26666668057441711), (0.45378151535987854,
-0.27058824896812439, 0.27058824896812439), (0.45798319578170776,
-0.27058824896812439, 0.27058824896812439), (0.46218487620353699,
-0.27450981736183167, 0.27450981736183167), (0.46638655662536621,
-0.27843138575553894, 0.27843138575553894), (0.47058823704719543,
-0.28627452254295349, 0.28627452254295349), (0.47478991746902466,
-0.29803922772407532, 0.29803922772407532), (0.47899159789085388,
-0.30588236451148987, 0.30588236451148987), (0.48319327831268311,
-0.31764706969261169, 0.31764706969261169), (0.48739495873451233,
-0.32549020648002625, 0.32549020648002625), (0.49159663915634155,
-0.33725491166114807, 0.33725491166114807), (0.49579831957817078,
-0.34509804844856262, 0.34509804844856262), (0.5, 0.35686275362968445,
-0.35686275362968445), (0.50420171022415161, 0.36862745881080627,
-0.36862745881080627), (0.50840336084365845, 0.37647059559822083,
-0.37647059559822083), (0.51260507106781006, 0.38823530077934265,
-0.38823530077934265), (0.51680672168731689, 0.3960784375667572,
-0.3960784375667572), (0.52100843191146851, 0.40784314274787903,
-0.40784314274787903), (0.52521008253097534, 0.41568627953529358,
-0.41568627953529358), (0.52941179275512695, 0.42745098471641541,
-0.42745098471641541), (0.53361344337463379, 0.43529412150382996,
-0.43529412150382996), (0.5378151535987854, 0.44705882668495178,
-0.44705882668495178), (0.54201680421829224, 0.45882353186607361,
-0.45882353186607361), (0.54621851444244385, 0.46666666865348816,
-0.46666666865348816), (0.55042016506195068, 0.47450980544090271,
-0.47450980544090271), (0.55462187528610229, 0.47843137383460999,
-0.47843137383460999), (0.55882352590560913, 0.48627451062202454,
-0.48627451062202454), (0.56302523612976074, 0.49411764740943909,
-0.49411764740943909), (0.56722688674926758, 0.50196081399917603,
-0.50196081399917603), (0.57142859697341919, 0.5058823823928833,
-0.5058823823928833), (0.57563024759292603, 0.51372551918029785,
-0.51372551918029785), (0.57983195781707764, 0.5215686559677124,
-0.5215686559677124), (0.58403360843658447, 0.52941179275512695,
-0.52941179275512695), (0.58823531866073608, 0.53333336114883423,
-0.53333336114883423), (0.59243696928024292, 0.54117649793624878,
-0.54117649793624878), (0.59663867950439453, 0.54901963472366333,
-0.54901963472366333), (0.60084033012390137, 0.55294120311737061,
-0.55294120311737061), (0.60504204034805298, 0.56078433990478516,
-0.56078433990478516), (0.60924369096755981, 0.56862747669219971,
-0.56862747669219971), (0.61344540119171143, 0.57647061347961426,
-0.57647061347961426), (0.61764705181121826, 0.58431375026702881,
-0.58431375026702881), (0.62184876203536987, 0.58823531866073608,
-0.58823531866073608), (0.62605041265487671, 0.59607845544815063,
-0.59607845544815063), (0.63025212287902832, 0.60392159223556519,
-0.60392159223556519), (0.63445377349853516, 0.61176472902297974,
-0.61176472902297974), (0.63865548372268677, 0.61568629741668701,
-0.61568629741668701), (0.6428571343421936, 0.62352943420410156,
-0.62352943420410156), (0.64705884456634521, 0.63137257099151611,
-0.63137257099151611), (0.65126049518585205, 0.63921570777893066,
-0.63921570777893066), (0.65546220541000366, 0.64705884456634521,
-0.64705884456634521), (0.6596638560295105, 0.65098041296005249,
-0.65098041296005249), (0.66386556625366211, 0.65882354974746704,
-0.65882354974746704), (0.66806721687316895, 0.66666668653488159,
-0.66666668653488159), (0.67226892709732056, 0.67450982332229614,
-0.67450982332229614), (0.67647057771682739, 0.68235296010971069,
-0.68235296010971069), (0.680672287940979, 0.68627452850341797,
-0.68627452850341797), (0.68487393856048584, 0.69411766529083252,
-0.69411766529083252), (0.68907564878463745, 0.70196080207824707,
-0.70196080207824707), (0.69327729940414429, 0.70980393886566162,
-0.70980393886566162), (0.6974790096282959, 0.71764707565307617,
-0.71764707565307617), (0.70168066024780273, 0.71764707565307617,
-0....
[truncated message content] |
|
From: <ry...@us...> - 2009-08-31 17:42:47
|
Revision: 7619
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7619&view=rev
Author: ryanmay
Date: 2009-08-31 17:42:37 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Merged revisions 7616-7618 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7616 | ryanmay | 2009-08-31 12:27:12 -0500 (Mon, 31 Aug 2009) | 1 line
Update barb_demo.py with an example using masked arrays.
........
r7617 | ryanmay | 2009-08-31 12:29:41 -0500 (Mon, 31 Aug 2009) | 1 line
Pull _parse_args out of Quiver and Barbs classes, as we have multiple, diverging copies of the same code. Now the shared code will actually be shared.
........
r7618 | ryanmay | 2009-08-31 12:34:50 -0500 (Mon, 31 Aug 2009) | 1 line
Use atleast_1d instead of asanyarray. This allows passing in scalars to quiver/barbs.
........
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/barb_demo.py
trunk/matplotlib/lib/matplotlib/quiver.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/examples/misc/multiprocess.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7607
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253 /branches/v0_99_maint:1-7618
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Modified: trunk/matplotlib/examples/pylab_examples/barb_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/barb_demo.py 2009-08-31 17:34:50 UTC (rev 7618)
+++ trunk/matplotlib/examples/pylab_examples/barb_demo.py 2009-08-31 17:42:37 UTC (rev 7619)
@@ -28,7 +28,7 @@
ax.barbs(data['x'], data['y'], data['u'], data['v'], length=8, pivot='middle')
#Showing colormapping with uniform grid. Fill the circle for an empty barb,
-#don't round the values, and change some of the size parameters
+#don't round the values, and change some of the size parameters
ax = plt.subplot(2,2,3)
ax.barbs(X, Y, U, V, np.sqrt(U*U + V*V), fill_empty=True, rounding=False,
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3))
@@ -39,4 +39,15 @@
barbcolor=['b','g'], barb_increments=dict(half=10, full=20, flag=100),
flip_barb=True)
+#Masked arrays are also supported
+masked_u = np.ma.masked_array(data['u'])
+masked_u[4] = 1000 #Bad value that should not be plotted when masked
+masked_u[4] = np.ma.masked
+
+#Identical plot to panel 2 in the first figure, but with the point at
+#(0.5, 0.25) missing (masked)
+fig2 = plt.figure()
+ax = fig2.add_subplot(1, 1, 1)
+ax.barbs(data['x'], data['y'], masked_u, data['v'], length=8, pivot='middle')
+
plt.show()
Modified: trunk/matplotlib/lib/matplotlib/quiver.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/quiver.py 2009-08-31 17:34:50 UTC (rev 7618)
+++ trunk/matplotlib/lib/matplotlib/quiver.py 2009-08-31 17:42:37 UTC (rev 7619)
@@ -325,6 +325,33 @@
quiverkey_doc = _quiverkey_doc
+# This is a helper function that parses out the various combination of
+# arguments for doing colored vector plots. Pulling it out here
+# allows both Quiver and Barbs to use it
+def _parse_args(*args):
+ X, Y, U, V, C = [None]*5
+ args = list(args)
+
+ # The use of atleast_1d allows for handling scalar arguments while also
+ # keeping masked arrays
+ if len(args) == 3 or len(args) == 5:
+ C = np.atleast_1d(args.pop(-1))
+ V = np.atleast_1d(args.pop(-1))
+ U = np.atleast_1d(args.pop(-1))
+ if U.ndim == 1:
+ nr, nc = 1, U.shape[0]
+ else:
+ nr, nc = U.shape
+ if len(args) == 2: # remaining after removing U,V,C
+ X, Y = [np.array(a).ravel() for a in args]
+ if len(X) == nc and len(Y) == nr:
+ X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
+ else:
+ indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
+ X, Y = [np.ravel(a) for a in indexgrid]
+ return X, Y, U, V, C
+
+
class Quiver(collections.PolyCollection):
"""
Specialized PolyCollection for arrows.
@@ -351,7 +378,7 @@
by the following pylab interface documentation:
%s"""
self.ax = ax
- X, Y, U, V, C = self._parse_args(*args)
+ X, Y, U, V, C = _parse_args(*args)
self.X = X
self.Y = Y
self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis]))
@@ -390,26 +417,6 @@
self.ax.figure.callbacks.connect('dpi_changed', on_dpi_change)
- def _parse_args(self, *args):
- X, Y, U, V, C = [None]*5
- args = list(args)
- if len(args) == 3 or len(args) == 5:
- C = np.asanyarray(args.pop(-1))
- V = np.asanyarray(args.pop(-1))
- U = np.asanyarray(args.pop(-1))
- if U.ndim == 1:
- nr, nc = 1, U.shape[0]
- else:
- nr, nc = U.shape
- if len(args) == 2: # remaining after removing U,V,C
- X, Y = [np.array(a).ravel() for a in args]
- if len(X) == nc and len(Y) == nr:
- X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
- else:
- indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
- X, Y = [np.ravel(a) for a in indexgrid]
- return X, Y, U, V, C
-
def _init(self):
"""initialization delayed until first draw;
allow time for axes setup.
@@ -762,7 +769,7 @@
kw['facecolors'] = flagcolor
#Parse out the data arrays from the various configurations supported
- x, y, u, v, c = self._parse_args(*args)
+ x, y, u, v, c = _parse_args(*args)
self.x = x
self.y = y
xy = np.hstack((x[:,np.newaxis], y[:,np.newaxis]))
@@ -942,28 +949,6 @@
return barb_list
- #Taken shamelessly from Quiver
- def _parse_args(self, *args):
- X, Y, U, V, C = [None]*5
- args = list(args)
- if len(args) == 3 or len(args) == 5:
- C = ma.masked_invalid(args.pop(-1), copy=False).ravel()
- V = ma.masked_invalid(args.pop(-1), copy=False)
- U = ma.masked_invalid(args.pop(-1), copy=False)
- nn = np.shape(U)
- nc = nn[0]
- nr = 1
- if len(nn) > 1:
- nr = nn[1]
- if len(args) == 2: # remaining after removing U,V,C
- X, Y = [np.array(a).ravel() for a in args]
- if len(X) == nc and len(Y) == nr:
- X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
- else:
- indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
- X, Y = [np.ravel(a) for a in indexgrid]
- return X, Y, U, V, C
-
def set_UVC(self, U, V, C=None):
self.u = ma.masked_invalid(U, copy=False).ravel()
self.v = ma.masked_invalid(V, copy=False).ravel()
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-08-31 17:34:58
|
Revision: 7618
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7618&view=rev
Author: ryanmay
Date: 2009-08-31 17:34:50 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Use atleast_1d instead of asanyarray. This allows passing in scalars to quiver/barbs.
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/quiver.py
Modified: branches/v0_99_maint/lib/matplotlib/quiver.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/quiver.py 2009-08-31 17:29:41 UTC (rev 7617)
+++ branches/v0_99_maint/lib/matplotlib/quiver.py 2009-08-31 17:34:50 UTC (rev 7618)
@@ -323,16 +323,20 @@
quiverkey_doc = _quiverkey_doc
+
# This is a helper function that parses out the various combination of
# arguments for doing colored vector plots. Pulling it out here
# allows both Quiver and Barbs to use it
def _parse_args(*args):
X, Y, U, V, C = [None]*5
args = list(args)
+
+ # The use of atleast_1d allows for handling scalar arguments while also
+ # keeping masked arrays
if len(args) == 3 or len(args) == 5:
- C = np.asanyarray(args.pop(-1))
- V = np.asanyarray(args.pop(-1))
- U = np.asanyarray(args.pop(-1))
+ C = np.atleast_1d(args.pop(-1))
+ V = np.atleast_1d(args.pop(-1))
+ U = np.atleast_1d(args.pop(-1))
if U.ndim == 1:
nr, nc = 1, U.shape[0]
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-08-31 17:29:49
|
Revision: 7617
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7617&view=rev
Author: ryanmay
Date: 2009-08-31 17:29:41 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Pull _parse_args out of Quiver and Barbs classes, as we have multiple, diverging copies of the same code. Now the shared code will actually be shared.
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/quiver.py
Modified: branches/v0_99_maint/lib/matplotlib/quiver.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/quiver.py 2009-08-31 17:27:12 UTC (rev 7616)
+++ branches/v0_99_maint/lib/matplotlib/quiver.py 2009-08-31 17:29:41 UTC (rev 7617)
@@ -323,7 +323,30 @@
quiverkey_doc = _quiverkey_doc
+# This is a helper function that parses out the various combination of
+# arguments for doing colored vector plots. Pulling it out here
+# allows both Quiver and Barbs to use it
+def _parse_args(*args):
+ X, Y, U, V, C = [None]*5
+ args = list(args)
+ if len(args) == 3 or len(args) == 5:
+ C = np.asanyarray(args.pop(-1))
+ V = np.asanyarray(args.pop(-1))
+ U = np.asanyarray(args.pop(-1))
+ if U.ndim == 1:
+ nr, nc = 1, U.shape[0]
+ else:
+ nr, nc = U.shape
+ if len(args) == 2: # remaining after removing U,V,C
+ X, Y = [np.array(a).ravel() for a in args]
+ if len(X) == nc and len(Y) == nr:
+ X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
+ else:
+ indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
+ X, Y = [np.ravel(a) for a in indexgrid]
+ return X, Y, U, V, C
+
class Quiver(collections.PolyCollection):
"""
Specialized PolyCollection for arrows.
@@ -343,7 +366,7 @@
"""
def __init__(self, ax, *args, **kw):
self.ax = ax
- X, Y, U, V, C = self._parse_args(*args)
+ X, Y, U, V, C = _parse_args(*args)
self.X = X
self.Y = Y
self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis]))
@@ -388,26 +411,6 @@
by the following pylab interface documentation:
%s""" % _quiver_doc
- def _parse_args(self, *args):
- X, Y, U, V, C = [None]*5
- args = list(args)
- if len(args) == 3 or len(args) == 5:
- C = np.asanyarray(args.pop(-1))
- V = np.asanyarray(args.pop(-1))
- U = np.asanyarray(args.pop(-1))
- if U.ndim == 1:
- nr, nc = 1, U.shape[0]
- else:
- nr, nc = U.shape
- if len(args) == 2: # remaining after removing U,V,C
- X, Y = [np.array(a).ravel() for a in args]
- if len(X) == nc and len(Y) == nr:
- X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
- else:
- indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
- X, Y = [np.ravel(a) for a in indexgrid]
- return X, Y, U, V, C
-
def _init(self):
"""initialization delayed until first draw;
allow time for axes setup.
@@ -752,7 +755,7 @@
kw['facecolors'] = flagcolor
#Parse out the data arrays from the various configurations supported
- x, y, u, v, c = self._parse_args(*args)
+ x, y, u, v, c = _parse_args(*args)
self.x = x
self.y = y
xy = np.hstack((x[:,np.newaxis], y[:,np.newaxis]))
@@ -938,28 +941,6 @@
return barb_list
- #Taken shamelessly from Quiver
- def _parse_args(self, *args):
- X, Y, U, V, C = [None]*5
- args = list(args)
- if len(args) == 3 or len(args) == 5:
- C = ma.masked_invalid(args.pop(-1), copy=False).ravel()
- V = ma.masked_invalid(args.pop(-1), copy=False)
- U = ma.masked_invalid(args.pop(-1), copy=False)
- nn = np.shape(U)
- nc = nn[0]
- nr = 1
- if len(nn) > 1:
- nr = nn[1]
- if len(args) == 2: # remaining after removing U,V,C
- X, Y = [np.array(a).ravel() for a in args]
- if len(X) == nc and len(Y) == nr:
- X, Y = [a.ravel() for a in np.meshgrid(X, Y)]
- else:
- indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
- X, Y = [np.ravel(a) for a in indexgrid]
- return X, Y, U, V, C
-
def set_UVC(self, U, V, C=None):
self.u = ma.masked_invalid(U, copy=False).ravel()
self.v = ma.masked_invalid(V, copy=False).ravel()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-08-31 17:27:22
|
Revision: 7616
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7616&view=rev
Author: ryanmay
Date: 2009-08-31 17:27:12 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
Update barb_demo.py with an example using masked arrays.
Modified Paths:
--------------
branches/v0_99_maint/examples/pylab_examples/barb_demo.py
Modified: branches/v0_99_maint/examples/pylab_examples/barb_demo.py
===================================================================
--- branches/v0_99_maint/examples/pylab_examples/barb_demo.py 2009-08-31 16:48:46 UTC (rev 7615)
+++ branches/v0_99_maint/examples/pylab_examples/barb_demo.py 2009-08-31 17:27:12 UTC (rev 7616)
@@ -28,7 +28,7 @@
ax.barbs(data['x'], data['y'], data['u'], data['v'], length=8, pivot='middle')
#Showing colormapping with uniform grid. Fill the circle for an empty barb,
-#don't round the values, and change some of the size parameters
+#don't round the values, and change some of the size parameters
ax = plt.subplot(2,2,3)
ax.barbs(X, Y, U, V, np.sqrt(U*U + V*V), fill_empty=True, rounding=False,
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3))
@@ -39,4 +39,15 @@
barbcolor=['b','g'], barb_increments=dict(half=10, full=20, flag=100),
flip_barb=True)
+#Masked arrays are also supported
+masked_u = np.ma.masked_array(data['u'])
+masked_u[4] = 1000 #Bad value that should not be plotted when masked
+masked_u[4] = np.ma.masked
+
+#Identical plot to panel 2 in the first figure, but with the point at
+#(0.5, 0.25) missing (masked)
+fig2 = plt.figure()
+ax = fig2.add_subplot(1, 1, 1)
+ax.barbs(data['x'], data['y'], masked_u, data['v'], length=8, pivot='middle')
+
plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-31 16:48:57
|
Revision: 7615
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7615&view=rev
Author: astraw
Date: 2009-08-31 16:48:46 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
buildbot: allow passing arguments to select virtualenv and nose
This is useful for getting the buildbot to run Python2.4.
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_install.py
Modified: trunk/matplotlib/test/_buildbot_install.py
===================================================================
--- trunk/matplotlib/test/_buildbot_install.py 2009-08-31 15:31:46 UTC (rev 7614)
+++ trunk/matplotlib/test/_buildbot_install.py 2009-08-31 16:48:46 UTC (rev 7615)
@@ -2,9 +2,21 @@
faciltate testing."""
import shutil, os, sys
from subprocess import Popen, PIPE, STDOUT
+from optparse import OptionParser
from _buildbot_util import check_call
+usage = """%prog [options]"""
+parser = OptionParser(usage)
+parser.add_option('--virtualenv',type='string',default='virtualenv',
+ help='string to invoke virtualenv')
+parser.add_option('--easy-install-nose',action='store_true',default=False,
+ help='run "easy_install nose" in the virtualenv')
+(options, args) = parser.parse_args()
+if len(args)!=0:
+ parser.print_help()
+ sys.exit(0)
+
TARGET='PYmpl'
if os.path.exists(TARGET):
@@ -15,6 +27,10 @@
if os.path.exists(build_path):
shutil.rmtree(build_path)
-check_call('virtualenv %s'%(TARGET,))
+check_call('%s %s'%(options.virtualenv,TARGET))
TARGET_py = os.path.join(TARGET,'bin','python')
+TARGET_easy_install = os.path.join(TARGET,'bin','easy_install')
+
+if options.easy_install_nose:
+ check_call('%s nose'%TARGET_easy_install)
check_call('%s setup.py install'%TARGET_py)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-08-31 15:31:54
|
Revision: 7614
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7614&view=rev
Author: mdboom
Date: 2009-08-31 15:31:46 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
[2832896] raster scale error in PDF, EPS output
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/image.py
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 05:23:37 UTC (rev 7613)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2009-08-31 15:31:46 UTC (rev 7614)
@@ -140,7 +140,7 @@
# space) in the following call to draw_text_image).
font.set_text(s, 0, flags=LOAD_FORCE_AUTOHINT)
font.draw_glyphs_to_bitmap()
-
+
#print x, y, int(x), int(y), s
self._renderer.draw_text_image(font.get_image(), int(x), int(y) + 1, angle, gc)
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2009-08-31 05:23:37 UTC (rev 7613)
+++ trunk/matplotlib/lib/matplotlib/image.py 2009-08-31 15:31:46 UTC (rev 7614)
@@ -141,7 +141,7 @@
gc = renderer.new_gc()
gc.set_clip_rectangle(self.axes.bbox.frozen())
gc.set_clip_path(self.get_clip_path())
- renderer.draw_image(gc, round(l), round(b), im)
+ renderer.draw_image(gc, l, b, im)
def contains(self, mouseevent):
"""
@@ -421,10 +421,8 @@
ty = (ymin-self.axes.viewLim.y0)/dyintv * numrows
l, b, r, t = self.axes.bbox.extents
- widthDisplay = (round(r) + 0.5) - (round(l) - 0.5)
- heightDisplay = (round(t) + 0.5) - (round(b) - 0.5)
- widthDisplay *= magnification
- heightDisplay *= magnification
+ widthDisplay = (round(r*magnification) + 0.5) - (round(l*magnification) - 0.5)
+ heightDisplay = (round(t*magnification) + 0.5) - (round(b*magnification) - 0.5)
im.apply_translation(tx, ty)
# resize viewport to display
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2009-08-31 05:23:37 UTC (rev 7613)
+++ trunk/matplotlib/src/_backend_agg.cpp 2009-08-31 15:31:46 UTC (rev 7614)
@@ -803,8 +803,8 @@
args.verify_length(4);
GCAgg gc(args[0], dpi);
- double x = Py::Float(args[1]);
- double y = Py::Float(args[2]);
+ double x = mpl_round(Py::Float(args[1]));
+ double y = mpl_round(Py::Float(args[2]));
Image *image = static_cast<Image*>(args[3].ptr());
bool has_clippath = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-31 05:23:44
|
Revision: 7613
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7613&view=rev
Author: astraw
Date: 2009-08-31 05:23:37 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
buildbot: removed forced error
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-31 04:46:55 UTC (rev 7612)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-31 05:23:37 UTC (rev 7613)
@@ -45,8 +45,6 @@
#--------------------------------------------------------------------
def test_empty_datetime( self ):
"""Test plotting empty axes with dates along one axis."""
- if 1:
- raise RuntimeError('error forced to test buildbot error reporting')
fname = self.outFile( "empty_datetime.png" )
t0 = datetime(2009, 1, 20)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-31 04:47:03
|
Revision: 7612
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7612&view=rev
Author: astraw
Date: 2009-08-31 04:46:55 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
buildbot: force error to test reporting abilities
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/TestAxes.py
Modified: trunk/matplotlib/test/test_matplotlib/TestAxes.py
===================================================================
--- trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-31 02:48:42 UTC (rev 7611)
+++ trunk/matplotlib/test/test_matplotlib/TestAxes.py 2009-08-31 04:46:55 UTC (rev 7612)
@@ -45,6 +45,8 @@
#--------------------------------------------------------------------
def test_empty_datetime( self ):
"""Test plotting empty axes with dates along one axis."""
+ if 1:
+ raise RuntimeError('error forced to test buildbot error reporting')
fname = self.outFile( "empty_datetime.png" )
t0 = datetime(2009, 1, 20)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-31 02:48:50
|
Revision: 7611
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7611&view=rev
Author: jdh2358
Date: 2009-08-31 02:48:42 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
update known good baselines using freetype 2.3.5
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
trunk/matplotlib/test/test_matplotlib/baseline/TestTickers/RRuleLocator_bounds.png
trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestTickers/RRuleLocator_bounds.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|