Ipython fails to display matplotlib fig directly

See my following example:

In [8]: %matplotlib inline
   ...: 
   ...: import matplotlib.pyplot as plt
   ...: import matplotlib.ticker as ticker
   ...: 
   ...: # Create a simple plot
   ...: fig, ax = plt.subplots()
   ...: ax.plot([1, 2, 3, 4], [10, 20, 15, 25])
   ...: 
   ...: # Use AutoLocator to dynamically determine tick positions
   ...: ax.xaxis.set_major_locator(ticker.AutoLocator())
   ...: 
   ...: plt.show()
Shell is already running a gui event loop for tk. Call with no arguments to disable the current loop.
<Figure size 640x480 with 1 Axes>

How can I let ipython display the matplotlib fig directly?

See here for the related discussion.

Regards,
Zhao

Consider just using %matplotlib instead of %matplotlib inline if you are using ipython in the shell