Otherwise, it might be worth playing around with your render backend.

In your code, you can add the following snipped *before* any other imports of 
matplotlib:

    import matplotlib
    matplotlib.use('TkAgg')
    import matplotlib.pyplot as plt

Other options are: Qt4Agg, MacOSX

It's possible it's choosing the "Agg" renderer which is non-interactive.

If another backend works (e.g. I use TkAgg myself) then you can add it to the 
file ~/.matplotlib/matplotlibrc as:

    backend : TkAgg

Simon

> On 25 Apr 2016, at 19:55, Pepper R. <ryan.pep...@soton.ac.uk> wrote:
> 
> Are you sure it's not gone behind your other windows? This is what seems to 
> happen by default on OS X with matplotlib.
> 
> R
> ________________________________________
> From: python-uk [python-uk-bounces+rp20g15=soton.ac...@python.org] on behalf 
> of gvim [gvi...@gmail.com]
> Sent: 25 April 2016 19:28
> To: UK Python Users
> Subject: [python-uk] Matplotlib show() doesn't display on OS X
> 
> I ran this simple script taken from a book:
> 
> #!/usr/bin/env python3
> 
> import matplotlib.pyplot as plt
> 
> squares = [1, 4, 9, 16, 25]
> plt.plot(squares)
> plt.show()
> 
> 
> ... but although the script runs without error it doesn't display
> anything, doesn't terminate and is unresponsive to either Ctrl+C or Ctrl+D.
> 
> gvim
> 
> _______________________________________________
> python-uk mailing list
> python-uk@python.org
> https://mail.python.org/mailman/listinfo/python-uk
> _______________________________________________
> python-uk mailing list
> python-uk@python.org
> https://mail.python.org/mailman/listinfo/python-uk

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
python-uk mailing list
python-uk@python.org
https://mail.python.org/mailman/listinfo/python-uk

Reply via email to