I'm still new to IPython Notebooks, Jupyter, and Python in general.
I'm creating a scatter plot in a Jupyter notebook using the following code:
import numpy as np
import matplotlib.pyplot as plt
n = 1024
X = np.random.normal(0, 1, n)
Y = np.random.normal(0, 1, n)
plt.axes([0.025, 0.025, 0.95, 0.95])
plt.scatter(X, Y, s=50)
plt.show()
My question is, how can I get a reference to the plot object so I can use it in a different cell later on in the notebook? Additionally, I may need to modify the plot before showing it again.
Also, I have %matplotlib inline
at the top of my notebook.
Here are some info about my environment:
- Python: 3.5.2 64bit [MSC v.1900 64 bit (AMD64)]
- IPython: 4.2.0
- numpy: 1.11.1
- scipy: 0.17.1
- matplotlib: 1.5.1
- sympy: 1.0
- OS: Windows 7 6.1.7601 SP1