Skip to content

2.0 Examples fixes. See #6762 #6786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
2.0 Examples fixes. See #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
  • Loading branch information
mlub committed Jul 18, 2016
commit eb41064cb741eccffa5377a4c71724a1645cbe1a
4 changes: 2 additions & 2 deletions examples/axes_grid1/demo_colorbar_with_inset_locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
height="5%", # height : 50%
loc=1)

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

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

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

plt.draw()
Expand Down
2 changes: 1 addition & 1 deletion examples/axes_grid1/simple_axesgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
)

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

plt.show()
1 change: 1 addition & 0 deletions examples/event_handling/looking_glass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)
ax.set_title("Left click and drag to move looking glass")


class EventHandler(object):
def __init__(self):
fig.canvas.mpl_connect('button_press_event', self.onpress)
Expand Down
8 changes: 3 additions & 5 deletions examples/event_handling/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,18 @@ def update(self, ax):
ax.figure.canvas.draw_idle()

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

d = DataDisplayDownsampler(xdata, ydata)

fig, ax = plt.subplots()

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

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

plt.show()