Skip to content

Commit

Permalink
Merge 479f9ba into f90367a
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Nov 23, 2015
2 parents f90367a + 479f9ba commit 8515ef9
Show file tree
Hide file tree
Showing 96 changed files with 2,766 additions and 1,066 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
*.ipynb
*.ipynb_checkpoints/

#########################################
# OS-specific temporary and backup files
.DS_Store

.ipynb_checkpoints*
*.ipynb

#########################################
# Editor temporary/working/backup files #
.#*
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ install:
# Always install from pypi
- pip install $PRE pep8 cycler coveralls coverage
- 'pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose'

- pip install git+https://github.com/ipython/traitlets.git#egg=traitlets
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
# version since is it basically just a .ttf file
Expand Down
70 changes: 70 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
-- INFILE --

#!DEPRECATED = dead method or code block
#!NOTE = see the commment

-- GENERAL --

# NEWTYPE = make traittype
# TRAITLET = make traitlet
# REFACTOR = change api

-- WORKFLOW --

0.0) not started

0.1) if relevant make new traittype
0.2) create class attr for traittype
0.3) implament new change handlers

# in Sublime Text
1.0) check for redefinition
1.1) identify class as of Artist
1.2) write relevant imports
1.3) make the method changes

# using tool/refactor_tool.py
2.0) locate method references
2.1) changed the method references

3.0) locate underscored attr references
3.1) change the underscored attrs

4.0) run partial test suite
4.1) rework for passing

5.0) run full test suite
5.1) rework for passing

6.0) complete

-- STATUS --

6.0 : transform
6.0 : transform_set
6.0 : stale
6.0 : axes
6.0 : figure
6.0 : visible
6.0 : animated
6.0 : alpha
6.0 : rasterized
6.0 : pickable
6.0 : clipbox
6.0 : clippath
6.0 : clipon
6.0 : url
6.0 : gid
6.0 : label
6.0 : contains
6.0 : picker
6.0 : mouseover
6.0 : agg_filter
6.0 : snap
6.0 : sketch_scale (new)
6.0 : sketch_length (new)
6.0 : sketch_randomness (new)
6.0 : sketch_params
6.0 : patheffects
...
...
4 changes: 2 additions & 2 deletions examples/api/demo_affine_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def imshow_affine(ax, z, *kl, **kwargs):
Z = get_image()
im1 = imshow_affine(ax1, Z, interpolation='none', cmap=cm.jet,
origin='lower',
extent=[-2, 4, -3, 2], clip_on=True)
extent=[-2, 4, -3, 2], clipon=True)

trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax1.transData
im1.set_transform(trans_data2)
Expand All @@ -58,7 +58,7 @@ def imshow_affine(ax, z, *kl, **kwargs):

im2 = ax2.imshow(Z, interpolation='none', cmap=cm.jet,
origin='lower',
extent=[-2, 4, -3, 2], clip_on=True)
extent=[-2, 4, -3, 2], clipon=True)
im2._image_skew_coordinate = (3, -2)

plt.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/axes_grid/demo_axes_grid2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def add_inner_title(ax, title, loc, size=None, **kwargs):
pad=0., borderpad=0.5,
frameon=False, **kwargs)
ax.add_artist(at)
at.txt._text.set_path_effects([withStroke(foreground="w", linewidth=3)])
at.txt._text.path_effects = [withStroke(foreground="w", linewidth=3)]
return at

if 1:
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/annotation_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
arrowprops=dict(facecolor='black', shrink=0.05),
horizontalalignment='left',
verticalalignment='bottom',
clip_on=True, # clip to the axes bounding box
clipon=True, # clip to the axes bounding box
)

ax.set_xlim(-20, 20)
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/broken_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

d = .015 # how big to make the diagonal lines in axes coordinates
# arguments to pass plot, just so we don't keep repeating them
kwargs = dict(transform=ax.transAxes, color='k', clip_on=False)
kwargs = dict(transform=ax.transAxes, color='k', clipon=False)
ax.plot((-d, +d), (-d, +d), **kwargs) # top-left diagonal
ax.plot((1 - d, 1 + d), (-d, +d), **kwargs) # top-right diagonal

Expand Down
6 changes: 3 additions & 3 deletions examples/pylab_examples/demo_agg_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def filtered_text(ax):
for t in cl:
t.set_color("k")
# to force TextPath (i.e., same font in all backends)
t.set_path_effects([Normal()])
t.path_effects = [Normal()]

# Add white glows to improve visibility of labels.
white_glows = FilteredArtistList(cl, GrowFilter(3))
Expand Down Expand Up @@ -254,7 +254,7 @@ def drop_shadow_line(ax):
# adjust zorder of the shadow lines so that it is drawn below the
# original lines
shadow.set_zorder(l.get_zorder() - 0.5)
shadow.set_agg_filter(gauss)
shadow.agg_filter = gauss
shadow.set_rasterized(True) # to support mixed-mode renderers

ax.set_xlim(0., 1.)
Expand Down Expand Up @@ -298,7 +298,7 @@ def light_filter_pie(ax):

light_filter = LightFilter(9)
for p in pies[0]:
p.set_agg_filter(light_filter)
p.agg_filter = light_filter
p.set_rasterized(True) # to support mixed-mode renderers
p.set(ec="none",
lw=2)
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/demo_bboximage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
bbox_image = BboxImage(txt.get_window_extent,
norm=None,
origin=None,
clip_on=False,
clipon=False,
**kwargs
)
a = np.arange(256).reshape(1, 256)/256.
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/image_clip_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

im = plt.imshow(Z, interpolation='bilinear', cmap=cm.gray,
origin='lower', extent=[-3, 3, -3, 3],
clip_path=patch, clip_on=True)
clip_path=patch, clipon=True)
im.set_clip_path(patch)

plt.show()
13 changes: 7 additions & 6 deletions examples/pylab_examples/patheffect_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
txt = ax1.annotate("test", (1., 1.), (0., 0),
arrowprops=dict(arrowstyle="->",
connectionstyle="angle3", lw=2),
size=20, ha="center", path_effects=[PathEffects.withStroke(linewidth=3,
foreground="w")])
txt.arrow_patch.set_path_effects([
size=20, ha="center",
path_effects=[PathEffects.withStroke(linewidth=3,
foreground="w")])
txt.arrow_patch.path_effects = [
PathEffects.Stroke(linewidth=5, foreground="w"),
PathEffects.Normal()])
PathEffects.Normal()]

ax1.grid(True, linestyle="-")

pe = [PathEffects.withStroke(linewidth=3,
foreground="w")]
for l in ax1.get_xgridlines() + ax1.get_ygridlines():
l.set_path_effects(pe)
l.path_effects = pe

ax2 = plt.subplot(132)
arr = np.arange(25).reshape((5, 5))
Expand All @@ -38,6 +39,6 @@
ax3 = plt.subplot(133)
p1, = ax3.plot([0, 1], [0, 1])
leg = ax3.legend([p1], ["Line 1"], fancybox=True, loc=2)
leg.legendPatch.set_path_effects([PathEffects.withSimplePatchShadow()])
leg.legendPatch.path_effects = [PathEffects.withSimplePatchShadow()]

plt.show()
2 changes: 1 addition & 1 deletion examples/pylab_examples/set_and_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
alpha = 1.0
antialiased = True
c = b
clip_on = True
clipon = True
color = b
... long listing skipped ...
Expand Down
8 changes: 4 additions & 4 deletions examples/pylab_examples/spine_placement_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ def adjust_spines(ax, spines):
y = 2*np.sin(x)

ax = fig.add_subplot(2, 2, 1)
ax.plot(x, y, clip_on=False)
ax.plot(x, y, clipon=False)
adjust_spines(ax, ['left'])

ax = fig.add_subplot(2, 2, 2)
ax.plot(x, y, clip_on=False)
ax.plot(x, y, clipon=False)
adjust_spines(ax, [])

ax = fig.add_subplot(2, 2, 3)
ax.plot(x, y, clip_on=False)
ax.plot(x, y, clipon=False)
adjust_spines(ax, ['left', 'bottom'])

ax = fig.add_subplot(2, 2, 4)
ax.plot(x, y, clip_on=False)
ax.plot(x, y, clipon=False)
adjust_spines(ax, ['bottom'])

plt.show()
2 changes: 1 addition & 1 deletion examples/pylab_examples/usetex_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
horizontalalignment='left',
verticalalignment='center',
rotation=90,
clip_on=False)
clipon=False)
plt.text(1.01, -0.02, "-1", {'color': 'k', 'fontsize': 20})
plt.text(1.01, 0.98, "1", {'color': 'k', 'fontsize': 20})
plt.text(1.01, 0.48, "0", {'color': 'k', 'fontsize': 20})
Expand Down
4 changes: 2 additions & 2 deletions examples/text_labels_and_annotations/rainbow_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def rainbow_text(x, y, strings, colors, ax=None, **kw):
text = ax.text(x, y, " " + s + " ", color=c, transform=t, **kw)
text.draw(canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, x=ex.width, units='dots')
t = transforms.offset_copy(text.private('transform'), x=ex.width, units='dots')

# vertical version
for s, c in zip(strings, colors):
text = ax.text(x, y, " " + s + " ", color=c, transform=t,
rotation=90, va='bottom', ha='center', **kw)
text.draw(canvas.get_renderer())
ex = text.get_window_extent()
t = transforms.offset_copy(text._transform, y=ex.height, units='dots')
t = transforms.offset_copy(text.private('transform'), y=ex.height, units='dots')


rainbow_text(0, 0, "all unicorns poop rainbows ! ! !".split(),
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,8 @@ def _init_draw(self):
figs = set()
for f in self.new_frame_seq():
for artist in f:
artist.set_visible(False)
artist.set_animated(self._blit)
artist.visible = False
artist.animated = self._blit
# Assemble a list of unique axes that need flushing
if artist.axes.figure not in figs:
figs.add(artist.axes.figure)
Expand All @@ -1061,7 +1061,7 @@ def _pre_draw(self, framedata, blit):
else:
# Otherwise, make all the artists from the previous frame invisible
for artist in self._drawn_artists:
artist.set_visible(False)
artist.visible = False

def _draw_frame(self, artists):
# Save the artists that were passed in as framedata for the other
Expand All @@ -1070,7 +1070,7 @@ def _draw_frame(self, artists):

# Make all the artists from the current frame visible
for artist in artists:
artist.set_visible(True)
artist.visible = True


class FuncAnimation(TimedAnimation):
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def _init_draw(self):
self._drawn_artists = self._init_func()
if self._blit:
for a in self._drawn_artists:
a.set_animated(self._blit)
a.animated = self._blit

def _draw_frame(self, framedata):
# Save the data for potential saving of movies.
Expand All @@ -1181,4 +1181,4 @@ def _draw_frame(self, framedata):
self._drawn_artists = self._func(framedata, *self._args)
if self._blit:
for a in self._drawn_artists:
a.set_animated(self._blit)
a.animated = self._blit
Loading

0 comments on commit 8515ef9

Please sign in to comment.