apply factor to numbers on axis

Hi everyone,

I wonder if there is a simple way to apply a multiplication factor to
the ticks labels of an axis.

say I'm plotting a 100 x 100 matrix with imshow and want the axis to
show (0 to 70) instead of (0 to 100), while still displaying the whole
matrix. In that case the coefficient would be 0.7.

I had a look at the Formatter class but I cannot find a method to do
that, do I've to implement a custom formatter or I'm missing something
obvious here ?

many thanks
Henry

Use the "extent" keyword argument to imshow to set the [xmin, xmax,
ymin, ymax] extent of the image

JDH

···

On Mon, Oct 6, 2008 at 3:52 AM, Henry Proudhon <henry.proudhon@...1839...> wrote:

Hi everyone,

I wonder if there is a simple way to apply a multiplication factor to
the ticks labels of an axis.

say I'm plotting a 100 x 100 matrix with imshow and want the axis to
show (0 to 70) instead of (0 to 100), while still displaying the whole
matrix. In that case the coefficient would be 0.7.

I had a look at the Formatter class but I cannot find a method to do
that, do I've to implement a custom formatter or I'm missing something
obvious here ?

Thanks a lot John, works great.

Henry

···

On Mon, 2008-10-06 at 08:04 -0500, John Hunter wrote:

On Mon, Oct 6, 2008 at 3:52 AM, Henry Proudhon <henry.proudhon@...1839...> wrote:
> Hi everyone,
>
> I wonder if there is a simple way to apply a multiplication factor to
> the ticks labels of an axis.
>
> say I'm plotting a 100 x 100 matrix with imshow and want the axis to
> show (0 to 70) instead of (0 to 100), while still displaying the whole
> matrix. In that case the coefficient would be 0.7.
>
> I had a look at the Formatter class but I cannot find a method to do
> that, do I've to implement a custom formatter or I'm missing something
> obvious here ?

Use the "extent" keyword argument to imshow to set the [xmin, xmax,
ymin, ymax] extent of the image

JDH