I’ve written a script that animates
but I can’t update the x axis. I’ve tried to scale up the bounding
box but I run in to trouble with “lazy” vaues which I don’t understand.
= self.canv.copy_from_bbox(boundingbox) # where self.canv is the
canvas
…
self.canv.restore_region(self.background)
Should I be trying to scale up the bounding
box? or should I be doing something else?
John
This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.
w/o seeing more of your code, it is hard to guess what you are trying
to do, but I'll hazard a guess that this is almost certainly not the
right approach. Modifying the lazy values directly is best left for
internal use or for very advanced mpl trickery -- I am not sure if I
have ever done it outside mpl in any of my code. You can read more
about them in the matplotlib.transforms documentation. Are you
working on code that someone else wrote, by chance?
ax.bbox is the rectangular region of the Axes (eg the "white" extent
of the axes) and if you wanted to change it you would use
ax.set_position([left, bottom, width, height]) which in turn would
call the "set" methods of the lazy values.
But my guess is you do not want to be modifying the axes bbox at all,
but rather the axes view limits, which sets the x and y extent of the
data coordinates. In that case you simply need to do
ax.set_xlim(xmin, xmax)
If you wanted to scale them by a factor of 2 as in your example, eg if
you wanted the range -3..3 to scale to -6..6, you would do
If I am not barking up the right tree, please post more code and
describe in more detail exactly what you need to do...
JDH
···
On 8/25/07, kollmanj@...1710... <kollmanj@...1710...> wrote:
I've written a script that animates but I can't update the x axis. I've
tried to scale up the bounding box but I run in to trouble with "lazy" vaues
which I don't understand.
Here are some snippits of
p.gca().update_datalim_numerix((-1000,1000),(-1000,1000)
boundingbox=self.a.bbox # where self. a is the axis
# boundingbox.scale(Value(2),Value(2)) #does not work
self.background = self.canv.copy_from_bbox(boundingbox) # where
self.canv is the canvas
...
self.canv.restore_region(self.background)
Should I be trying to scale up the bounding box? or should I be doing
something else?