TkAgg problem: blank plot on MacOS

I have a polar graph that works fine on linux but is blank on MacOS 10.9. Here is a minimal working example (using the API because it is part of a larger Tkinter application):

#!/usr/bin/env python2
import Tkinter
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

root = Tkinter.Tk()
root["bg"] = "green" # the green should be hidden by the plot

plotFig = matplotlib.figure.Figure(figsize=(5, 5), frameon=False)
figCanvas = FigureCanvasTkAgg(plotFig, root)
figCanvas.get_tk_widget().pack()
axis = plotFig.add_subplot(1, 1, 1, polar=True, autoscale_on=True)

r = (0.1, 0.4, 0.6, 0.8)
theta = (0, 1.5, 3.0, 4.5) # radians, 0 to right. pi/2 up
axis.plot(theta, r, marker="o", markeredgecolor="black", markersize=3)
figCanvas.draw()

root.mainloop()

On MacOS 10.9 when I run this from Terminal I see a green window (rather than the plot I expect). When I click on the plot window to bring it to the front, the window turns white with a thin black border (presumably the plot, but with no content).

Details:
- matplotlib 1.3.1
- Tcl/Tk 8.5.11 (for good reasons, unfortunately)
- python.org python 2.7.6, running in 32-bit mode (due to a known issue with MacOS 10.9 and this old version of Tcl/Tk)

Any ideas how to get the plot to show?

-- Russell

Looks like this is an incompatibility between Tcl/Tk 8.5.11 and MacOS 10.9. Tcl/Tk 8.5.15 does not show the problem. Time to try to build 8.5.17rc1 from source, I guess.

-- Russell

ยทยทยท

On 10/15/14 3:19 PM, Russell Owen wrote:

I have a polar graph that works fine on linux but is blank on MacOS
10.9. Here is a minimal working example (using the API because it is
part of a larger Tkinter application):

#!/usr/bin/env python2
import Tkinter
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

root = Tkinter.Tk()
root["bg"] = "green" # the green should be hidden by the plot

plotFig = matplotlib.figure.Figure(figsize=(5, 5), frameon=False)
figCanvas = FigureCanvasTkAgg(plotFig, root)
figCanvas.get_tk_widget().pack()
axis = plotFig.add_subplot(1, 1, 1, polar=True, autoscale_on=True)

r = (0.1, 0.4, 0.6, 0.8)
theta = (0, 1.5, 3.0, 4.5) # radians, 0 to right. pi/2 up
axis.plot(theta, r, marker="o", markeredgecolor="black", markersize=3)
figCanvas.draw()

root.mainloop()

On MacOS 10.9 when I run this from Terminal I see a green window (rather
than the plot I expect). When I click on the plot window to bring it to
the front, the window turns white with a thin black border (presumably
the plot, but with no content).

Details:
- matplotlib 1.3.1
- Tcl/Tk 8.5.11 (for good reasons, unfortunately)
- python.org python 2.7.6, running in 32-bit mode (due to a known issue
with MacOS 10.9 and this old version of Tcl/Tk)

Any ideas how to get the plot to show?