Problems with Matplotlib examples under Windows

Hi everyone - I am a complete newbie to Matplotlib but love the idea and
want to get to know it.

I am having problems with three of the matplotlib examples running
Jupyter Notebook under Windows. The same problem occurs consistently on
three different PCs, two running Win 7 Professional and one running Win
8.1. Matplotlib was obtained by installing 64 bit Anaconda3. I am also
using PyCharm 5.0.3 and seeing the same issues. I have done nothing to
modify any part of the Anaconda installation.
Matplotlib is version 1.5.0

I have also used the same setup under Linux Mint 17.2, where both in
Jupyter and PyCharm everything worked.

The three examples I have tried which failed are:
embedding_in_tk.py
embedding_in_tk2.py
and
embedding_in_tk_canvas.py

The results of all these failures are crashes of Python showing the
Windows error "Python has stopped working". In PyCharm I stepped through
the code to find where it crashed.
In:
embedding_in_tk.py
and
embedding_in_tk2.py
the crash occurred in the line
canvas.show()
   calling
   FigureCanvasTkAgg.draw() in backend_tkagg.py
     calling
     tkagg.blit() in tkagg.py
     and crashed in the second attempt at
       tk.call()

In:
embedding_in_tk_canvas.py (modified only to import tkinter.py for Python 3)
the crash occurred in the line
   fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y))
     calling
     draw_figure()
       failing in the line
       tkagg.blit()
         which calls
         get_renderer() in backend_agg.py
           which crashes at the end of the function in the line
           return self.renderer

I ensured at all times that Python 3.5 in Anaconda was used as the
interpreter.

I presume this is due to some difference in the OS's and would love to
hear what I can do about it!

Thanks, Chris.

···

--

Chris Corben.

At first glance, it seems like your windows machine doesn't have the TkAgg
backend. If everything else ran, I wouldn't working about this.

-paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160106/bd754c9b/attachment.html>

···

On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben <cjcorben at hoarybat.com> wrote:

Hi everyone - I am a complete newbie to Matplotlib but love the idea and
want to get to know it.

I am having problems with three of the matplotlib examples running Jupyter
Notebook under Windows. The same problem occurs consistently on three
different PCs, two running Win 7 Professional and one running Win 8.1.
Matplotlib was obtained by installing 64 bit Anaconda3. I am also using
PyCharm 5.0.3 and seeing the same issues. I have done nothing to modify any
part of the Anaconda installation.
Matplotlib is version 1.5.0

I have also used the same setup under Linux Mint 17.2, where both in
Jupyter and PyCharm everything worked.

The three examples I have tried which failed are:
embedding_in_tk.py
embedding_in_tk2.py
and
embedding_in_tk_canvas.py

The results of all these failures are crashes of Python showing the
Windows error "Python has stopped working". In PyCharm I stepped through
the code to find where it crashed.
In:
embedding_in_tk.py
and
embedding_in_tk2.py
the crash occurred in the line
canvas.show()
  calling
  FigureCanvasTkAgg.draw() in backend_tkagg.py
    calling
    tkagg.blit() in tkagg.py
    and crashed in the second attempt at
      tk.call()

In:
embedding_in_tk_canvas.py (modified only to import tkinter.py for Python
3)
the crash occurred in the line
  fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y))
    calling
    draw_figure()
      failing in the line
      tkagg.blit()
        which calls
        get_renderer() in backend_agg.py
          which crashes at the end of the function in the line
          return self.renderer

I ensured at all times that Python 3.5 in Anaconda was used as the
interpreter.

I presume this is due to some difference in the OS's and would love to
hear what I can do about it!

Thanks Paul.

I guess I expected Tkagg to be installed with Anaconda, and certainly
the tkagg.py file is present. Is there some thing else I need to do to
get the backend in my OS?

Chris.

···

On 1/6/2016 2:51 PM, Paul Hobson wrote:

On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben <cjcorben at hoarybat.com > <mailto:cjcorben at hoarybat.com>> wrote:

    Hi everyone - I am a complete newbie to Matplotlib but love the
    idea and want to get to know it.

    I am having problems with three of the matplotlib examples running
    Jupyter Notebook under Windows. The same problem occurs
    consistently on three different PCs, two running Win 7
    Professional and one running Win 8.1. Matplotlib was obtained by
    installing 64 bit Anaconda3. I am also using PyCharm 5.0.3 and
    seeing the same issues. I have done nothing to modify any part of
    the Anaconda installation.
    Matplotlib is version 1.5.0

    I have also used the same setup under Linux Mint 17.2, where both
    in Jupyter and PyCharm everything worked.

    The three examples I have tried which failed are:
    embedding_in_tk.py
    embedding_in_tk2.py
    and
    embedding_in_tk_canvas.py

    The results of all these failures are crashes of Python showing
    the Windows error "Python has stopped working". In PyCharm I
    stepped through the code to find where it crashed.
    In:
    embedding_in_tk.py
    and
    embedding_in_tk2.py
    the crash occurred in the line
    canvas.show()
      calling
      FigureCanvasTkAgg.draw() in backend_tkagg.py
        calling
        tkagg.blit() in tkagg.py
        and crashed in the second attempt at
          tk.call()

    In:
    embedding_in_tk_canvas.py (modified only to import tkinter.py for
    Python 3)
    the crash occurred in the line
      fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y))
        calling
        draw_figure()
          failing in the line
          tkagg.blit()
            which calls
            get_renderer() in backend_agg.py
              which crashes at the end of the function in the line
              return self.renderer

    I ensured at all times that Python 3.5 in Anaconda was used as the
    interpreter.

    I presume this is due to some difference in the OS's and would
    love to hear what I can do about it!

At first glance, it seems like your windows machine doesn't have the
TkAgg backend. If everything else ran, I wouldn't working about this.

-paul

--

Chris Corben.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160107/af234ec4/attachment.html>

Not sure. Maybe "conda install tk"?

···

On Thu, Jan 7, 2016 at 2:43 PM, Chris Corben <cjcorben at hoarybat.com> wrote:

Thanks Paul.

I guess I expected Tkagg to be installed with Anaconda, and certainly the
tkagg.py file is present. Is there some thing else I need to do to get the
backend in my OS?

Chris.

On 1/6/2016 2:51 PM, Paul Hobson wrote:

On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben <cjcorben at hoarybat.com> > wrote:

Hi everyone - I am a complete newbie to Matplotlib but love the idea and
want to get to know it.

I am having problems with three of the matplotlib examples running
Jupyter Notebook under Windows. The same problem occurs consistently on
three different PCs, two running Win 7 Professional and one running Win
8.1. Matplotlib was obtained by installing 64 bit Anaconda3. I am also
using PyCharm 5.0.3 and seeing the same issues. I have done nothing to
modify any part of the Anaconda installation.
Matplotlib is version 1.5.0

I have also used the same setup under Linux Mint 17.2, where both in
Jupyter and PyCharm everything worked.

The three examples I have tried which failed are:
embedding_in_tk.py
embedding_in_tk2.py
and
embedding_in_tk_canvas.py

The results of all these failures are crashes of Python showing the
Windows error "Python has stopped working". In PyCharm I stepped through
the code to find where it crashed.
In:
embedding_in_tk.py
and
embedding_in_tk2.py
the crash occurred in the line
canvas.show()
  calling
  FigureCanvasTkAgg.draw() in backend_tkagg.py
    calling
    tkagg.blit() in tkagg.py
    and crashed in the second attempt at
      tk.call()

In:
embedding_in_tk_canvas.py (modified only to import tkinter.py for Python
3)
the crash occurred in the line
  fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y))
    calling
    draw_figure()
      failing in the line
      tkagg.blit()
        which calls
        get_renderer() in backend_agg.py
          which crashes at the end of the function in the line
          return self.renderer

I ensured at all times that Python 3.5 in Anaconda was used as the
interpreter.

I presume this is due to some difference in the OS's and would love to
hear what I can do about it!

At first glance, it seems like your windows machine doesn't have the TkAgg
backend. If everything else ran, I wouldn't working about this.

-paul

--

Chris Corben.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160107/6857b46e/attachment.html>