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

Alan Gauld alan.gauld at yahoo.co.uk
Sun Nov 19 18:23:24 EST 2017


On 19/11/17 20:14, Stephen P. Molnar wrote:

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

You really need to post the entire error message not just the summary line.

Especially since you don't appear to access  _draw_solid in your own 
code so we need to see where that arises.

> Here it is:
> 
> #!/usr/bin/env python3
> # -*- coding: utf-8 -*-
> """
> Multiple_Plots_2_b.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+'_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)
> 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'
> fig.savefig(name_plt,bbox_inches='tight')
> 
> 




More information about the Tutor mailing list