I thought that some people may be interested in my IPython startup script. This is the script that IPython runs immediately after starting. The content of my file, which is located at .ipython/profile_default/startup/env.py
, is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os import sys from math import * import numpy as np import matplotlib as mpl mpl.use('Qt5Agg') import matplotlib.pylab as plt from numpy import median, mean, std, array, ndarray, argmin, argmax, where, roll from scipy.stats import mode, kurtosis, skew, cumfreq import pandas as pd from astropy.io import fits import astropy.wcs as wcs def imshow(image): plt.imshow(image, origin='lower') plt.ion() print("\nNote: Use plt.ioff() to turn pylab interactivity off; plt.ion() turns it back on.") |
This is very similar to the result that you would get by using the %pylab
magick function. Not everything that is set up by %pylab
is enabled by my script and several things that aren't included in the %pylab
are in this script. Most notably, I set up matplotlib to use the Qt5Agg backend, rather than the default, I load pandas, a few things from scipy and astropy.