Skip to content

Commit eb41064

Browse files
committed
2.0 Examples fixes. See matplotlib#6762
These are fixes for all issues found in axes_grid, color, and event_handling sections on the examples page. axisartist/demo_curvelinear_grid.py - Set linewidth=2.0 and grid zorder=0 so the plotted lines actually visible event_handling/keypress_demo.py - added usage instruction as axes title event_handling/lasso_demo.py - added usage instruction as axes title event_handling/looking_glass.py - added usage instruction as axes title event_handling/resample.py - removed gtk and hardcoded wave file dependencies and just created a sample signal within the script event_handling/trifinder_event_demo.py - zip(l1,l2) call changed to list(zip(l1,l2)) to be python3 compatible event_handling/viewlims.py - The focus box that is supposed to appear in the left axes when user zooms in the right axes wasn't visible. Set linewidth=1.0
1 parent 0e07fd2 commit eb41064

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

examples/axes_grid1/demo_colorbar_with_inset_locator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
height="5%", # height : 50%
1010
loc=1)
1111

12-
im1 = ax1.imshow([[1, 2], [2, 3]], interpolation='bilinear')
12+
im1 = ax1.imshow([[1, 2], [2, 3]])
1313
plt.colorbar(im1, cax=axins1, orientation="horizontal", ticks=[1, 2, 3])
1414
axins1.xaxis.set_ticks_position("bottom")
1515

@@ -26,7 +26,7 @@
2626
# of the legend. you may want to play with the borderpad value and
2727
# the bbox_to_anchor coordinate.
2828

29-
im = ax2.imshow([[1, 2], [2, 3]], interpolation='bilinear')
29+
im = ax2.imshow([[1, 2], [2, 3]])
3030
plt.colorbar(im, cax=axins, ticks=[1, 2, 3])
3131

3232
plt.draw()

examples/axes_grid1/simple_axesgrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
)
1313

1414
for i in range(4):
15-
grid[i].imshow(im, interpolation='bilinear') # The AxesGrid object work as a list of axes.
15+
grid[i].imshow(im) # The AxesGrid object work as a list of axes.
1616

1717
plt.show()

examples/event_handling/looking_glass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)
1313
ax.set_title("Left click and drag to move looking glass")
1414

15+
1516
class EventHandler(object):
1617
def __init__(self):
1718
fig.canvas.mpl_connect('button_press_event', self.onpress)

examples/event_handling/resample.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,18 @@ def update(self, ax):
3232
ax.figure.canvas.draw_idle()
3333

3434
# Create a signal
35-
xdata = np.linspace(16,365,365-16)
36-
ydata = np.sin(2*np.pi*xdata/153) + np.cos(2*np.pi*xdata/127);
35+
xdata = np.linspace(16, 365, 365-16)
36+
ydata = np.sin(2*np.pi*xdata/153) + np.cos(2*np.pi*xdata/127)
3737

3838
d = DataDisplayDownsampler(xdata, ydata)
3939

4040
fig, ax = plt.subplots()
4141

4242
# Hook up the line
43-
d.line, = ax.plot(xdata, ydata,'o-')
43+
d.line, = ax.plot(xdata, ydata, 'o-')
4444
ax.set_autoscale_on(False) # Otherwise, infinite loop
4545

4646
# Connect for changing the view limits
4747
ax.callbacks.connect('xlim_changed', d.update)
4848

4949
plt.show()
50-
51-

0 commit comments

Comments
 (0)