the problem about axe

hello everyone,

I have use maplotlib to show an image. the image is a map.
The problem is when I zoom in the map, The extent of self.ax changes to fix
my selected. However, I want the extent of self.ax stand unchanged. Only the
map's extent changed. Is there any suggestion?

        self.fig = Figure((8.8,6),facecolor='w')
        self.canvas= FigureCanvasWxAgg(frame, -1, self.fig)
        self.ax= self.fig.add_axes([0.17,0.15,0.7,0.7],axisbg='#ffffff')
        self.im = self.ax.imshow(Zm, norm = colors.Normalize(vmin =
valueSet[0], vmax = valueSet[1], clip =
False),cmap=palette,interpolation='nearest')

Thank you.
Huang.

···

--
View this message in context: http://www.nabble.com/the-problem-about-axe-tp23532518p23532518.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I'm not 100% what problem you are describing, but my hunch is that you
want aspect='equal' as a kwarg to imshow.

JDH

···

On Wed, May 13, 2009 at 7:50 PM, GoogleWind <googlewind@...1221...> wrote:

hello everyone,

I have use maplotlib to show an image. the image is a map.
The problem is when I zoom in the map, The extent of self.ax changes to fix
my selected. However, I want the extent of self.ax stand unchanged. Only the
map's extent changed. Is there any suggestion?

       self.fig = Figure((8.8,6),facecolor='w')
       self.canvas= FigureCanvasWxAgg(frame, -1, self.fig)
       self.ax= self.fig.add_axes([0.17,0.15,0.7,0.7],axisbg='#ffffff')
       self.im = self.ax.imshow(Zm, norm = colors.Normalize(vmin =
valueSet[0], vmax = valueSet[1], clip =
False),cmap=palette,interpolation='nearest')

Sorry, I meant aspect='auto'

JDH

···

On Thu, May 14, 2009 at 8:44 AM, John Hunter <jdh2358@...287...> wrote:

I'm not 100% what problem you are describing, but my hunch is that you
want aspect='equal' as a kwarg to imshow.

Yeah, Thank you.
This works. When I set aspect='auto', the im will not changed when I zoom in
or out. However another problem appears. When I changed the size of the
frame. The length to width ratio is changed. So the map get an unexpected
shape.
Is there other suggestion to avoid this.

Huang.

···

--
View this message in context: http://www.nabble.com/the-problem-about-axe-tp23532518p23551697.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

You need to try and explain more clearly what you want to happen under
what circumstances. You should also want to read and experiment with
the the various aspect options (auto, equal, ...)

http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.set_aspect

JDH

···

On Thu, May 14, 2009 at 7:59 PM, GoogleWind <googlewind@...1221...> wrote:

Yeah, Thank you.
This works. When I set aspect='auto', the im will not changed when I zoom in
or out. However another problem appears. When I changed the size of the
frame. The length to width ratio is changed. So the map get an unexpected
shape.
Is there other suggestion to avoid this.