[Tutor] AttributeError: 'BezierPath' object has no attribute '_draw_solid'

Stephen P. Molnar s.molnar at sbcglobal.net
Sun Nov 19 15:14:11 EST 2017

On 11/19/2017 03:10 PM, William Ray Wing wrote:
>> On Nov 19, 2017, at 11:36 AM, Stephen P. Molnar <s.molnar at sbcglobal.net> wrote:
>> I have written a short Python 3 script to plot three curves (one plot) of data from a FORTRAN program.  Initially the code worked and produced the plot which is attached.  I have also attached the code and the input data,
> The data made it through, neither the script nor the plot did.  If the script really is short, perhaps you could just cut and paste it into a follow-up msg.  Absent that, no one here can help you.
> Thanks,
> Bill
>> In all candor, I don't have the faintest idea as to whst the problem (or problens) might be and would greatly appreciate a pointer towards the solution.
>> Thanks in advance.
>> -- 
>> Stephen P. Molnar, Ph.D.		Life is a fuzzy set
>> www.molecular-modeling.net		Stochastic and multivariate
>> (614)312-7528 (c)
>> Skype: smolnar1
>> <A_poutput.txt>_______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor

Here it is:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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+'_poutput'
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)

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))


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))



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

name_plt = name+'-fig1.png'

Stephen P. Molnar, Ph.D.		Life is a fuzzy set
www.molecular-modeling.net		Stochastic and multivariate
(614)312-7528 (c)
Skype: smolnar1

More information about the Tutor mailing list