Skip to content

Instantly share code, notes, and snippets.

@kervel
Created April 2, 2020 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kervel/3322626dc746dc62e0581335a268ec2e to your computer and use it in GitHub Desktop.
Save kervel/3322626dc746dc62e0581335a268ec2e to your computer and use it in GitHub Desktop.
output = widgets.Output()
# create some x data
x = np.linspace(0, 2 * np.pi, 100)
# default line color
initial_color = '#FF00DD'
with output:
fig, ax = plt.subplots(constrained_layout=True, figsize=(6, 4))
# move the toolbar to the bottom
fig.canvas.toolbar_position = 'bottom'
ax.grid(True)
line, = ax.plot(x, np.sin(x), initial_color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment