I am running Spyder v-3.2.1 with Python v-3.5.3 on a Debian v-9 up to date 
Linux platform

I have started getting errors running a short Python script (attached) 
which plots data from a FORTRAN program.  The script had been working in 
the Spyder environment and still works when run from a terminal.  I have 
also attached a sample plot data fie and the plot when the script is ru ion 
a Bash terminal. 

The error causing the crash seems to be:

AttributeError: 'BezierPath' object has no attribute '_draw_solid'

I haven't the faintest idea as to what is going on, and I would greatly 
appreciate some pointers  towards a solution to this problem.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
Type "copyright", "credits" or "license" for more information.

IPython 6.1.0 -- An enhanced Interactive Python.

runfile('/home/comp/Apps/Python/Transforms_1/MultiplePlots_3.py', 
wdir='/home/comp/Apps/Python/Transforms_1')

Enter Molecule ID: Chrysene
Traceback (most recent call last):

  File "<ipython-input-1-8430305327e4>", line 1, in <module>
    runfile('/home/comp/Apps/Python/Transforms_1/MultiplePlots_3.py', 
wdir='/home/comp/Apps/Python/Transforms_1')

  File 
"/usr/local/lib/python3.5/dist-packages/spyder/utils/site/sitecustomize.py", 
line 688, in runfile
    execfile(filename, namespace)

  File 
"/usr/local/lib/python3.5/dist-packages/spyder/utils/site/sitecustomize.py", 
line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/comp/Apps/Python/Transforms_1/MultiplePlots_3.py", line 67, in 
<module>
    plt.draw()

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py", line 691, 
in draw
    get_current_fig_manager().canvas.draw_idle()

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", 
line 2053, in draw_idle
    self.draw(*args, **kwargs)

  File 
"/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_agg.py", 
line 430, in draw
    self.figure.draw(self.renderer)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 
1295, in draw
    renderer, self, artists, self.suppressComposite)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/image.py", line 138, 
in _draw_list_compositing_images
    a.draw(renderer)

  File 
"/usr/lib/python3/dist-packages/mpl_toolkits/axes_grid1/parasite_axes.py", line 
295, in draw
    self._get_base_axes_attr("draw")(self, renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axislines.py", 
line 778, in draw
    super(Axes, self).draw(renderer, inframe)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/axes/_base.py", line 
2399, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/image.py", line 138, 
in _draw_list_compositing_images
    a.draw(renderer)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 1572, in draw
    self._draw_line(renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 1170, in _draw_line
    self.line.draw(renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 163, in draw
    lineFunc = getattr(self, funcname)

AttributeError: 'BezierPath' object has no attribute '_draw_solid'

Traceback (most recent call last):

  File 
"/home/comp/.local/lib/python3.5/site-packages/IPython/core/formatters.py", 
line 332, in __call__
    return printer(obj)

  File 
"/home/comp/.local/lib/python3.5/site-packages/IPython/core/pylabtools.py", 
line 237, in <lambda>
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', 
**kwargs))

  File 
"/home/comp/.local/lib/python3.5/site-packages/IPython/core/pylabtools.py", 
line 121, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", 
line 2208, in print_figure
    **kwargs)

  File 
"/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_agg.py", 
line 507, in print_png
    FigureCanvasAgg.draw(self)

  File 
"/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_agg.py", 
line 430, in draw
    self.figure.draw(self.renderer)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line 
1295, in draw
    renderer, self, artists, self.suppressComposite)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/image.py", line 138, 
in _draw_list_compositing_images
    a.draw(renderer)

  File 
"/usr/lib/python3/dist-packages/mpl_toolkits/axes_grid1/parasite_axes.py", line 
295, in draw
    self._get_base_axes_attr("draw")(self, renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axislines.py", 
line 778, in draw
    super(Axes, self).draw(renderer, inframe)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/axes/_base.py", line 
2399, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/image.py", line 138, 
in _draw_list_compositing_images
    a.draw(renderer)

  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 55, 
in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 1572, in draw
    self._draw_line(renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 1170, in _draw_line
    self.line.draw(renderer)

  File "/usr/lib/python3/dist-packages/mpl_toolkits/axisartist/axis_artist.py", 
line 163, in draw
    lineFunc = getattr(self, funcname)

AttributeError: 'BezierPath' object has no attribute '_draw_solid'

<matplotlib.figure.Figure at 0x7fb2b72476a0>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Multiple_Plots_3.py

Copyright (c) 2017 Stephen P. Molnar, Ph.D.  All rights reserved.

"""
import numpy as np
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
import matplotlib.pyplot as plt

data = []
name = input("Enter Molecule ID: ")

name_in = name+'_P'
data = np.genfromtxt(name_in)

s = data[:,0]
FTm = data[:,1]     #atomic number
FTe = data[:,2]     #atomic mass
FTc = data[:,3]     #atom electron density


fig = plt.figure(figsize=(7.6,4))

host = host_subplot(111, axes_class=AA.Axes)
plt.subplots_adjust(right=0.75)

par1 = host.twinx()
par2 = host.twinx()

offset = 60
new_fixed_axis = par2.get_grid_helper().new_fixed_axis
par2.axis["right"] = new_fixed_axis(loc="right", axes=par2,
                                        offset=(offset, 0))

par2.axis["right"].toggle(all=True)

host.set_xlim(0, 30)
"""
host.set_ylim(min(FTm), max(FTm))
"""

host.set_xlabel("Distance ($\AA$)")
host.set_ylabel("Atomic Number")
par1.set_ylabel("Atom Mass")
par2.set_ylabel("Atom Electron Density")

p1, = host.plot(data[:,0], data[:,1])#, label="Atomic Number")
p2, = par1.plot(data[:,0], data[:,2])#, label="Atom Mass")
p3, = par2.plot(data[:,0], data[:,3])#, label="Atom Electron Density")

"""
par1.set_ylim(min(FTe), max(FTe))
par2.set_ylim(min(FTc),max(FTc))
""" 

#host.legend()

host.axis["left"].label.set_color(p1.get_color())
par1.axis["right"].label.set_color(p2.get_color())
par2.axis["right"].label.set_color(p3.get_color())

host.title.set_text('Molecule: {0} - Molecular Transforms'.format(name))
plt.draw()
plt.show()

#name_plt = name+'-fig1.png'
name_plt = name

fig.savefig(name_plt,bbox_inches='tight')

Attachment: Benzo[c]chrysene_P
Description: Binary data

Reply via email to