Hello, I try to generate dozens of plots where there is some static content for all plots and some content that changes. I'm porting the application from biggles to matplotlib. With biggles I could simply deepcopy the basis plot and add the content, but trying to deepcopy as my subplot instance I get:
File "/data/tmp/hoel/GLPy_numpy_conversion/lib/gl/hatchcoamdeflect/hatchcoamdeflect.py", line 664, in plotHatches nplot = copy.deepcopy(plot) File "/usr/local/gltools/python/Python-2.5/lib/python2.5/copy.py", line 162, in deepcopy y = copier(x, memo) File "/usr/local/gltools/python/Python-2.5/lib/python2.5/copy.py", line 291, in _deepcopy_inst state = deepcopy(state, memo) File "/usr/local/gltools/python/Python-2.5/lib/python2.5/copy.py", line 162, in deepcopy y = copier(x, memo) File "/usr/local/gltools/python/Python-2.5/lib/python2.5/copy.py", line 254, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/local/gltools/python/Python-2.5/lib/python2.5/copy.py", line 188, in deepcopy "un(deep)copyable object of type %s" % cls) copy.Error: un(deep)copyable object of type <type 'Affine'> Is there a way to get a deep copy of my object? I tried for artist in plot.get_child_artists(): if isinstance(artist, Line2D): nplot.add_line(artist) if isinstance(artist, Patch): nplot.add_patch(artist) else: nplot.add_artist(artist) but the result was not satisfying. The axes labels got copied also as, but what's worse (I could exclude Text instances), the scaling does not fit. The copied artists are painted much to large. Any tip avaliable? Thanks Berthold -- __ Address: G / \ L Germanischer Lloyd phone: +49-40-36149-7374 -+----+- Vorsetzen 35 P.O.Box 111606 fax : +49-40-36149-7320 \__/ D-20459 Hamburg D-20416 Hamburg ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users