Using 'scaled' for aspect ratio

The enhanced way of handling aspect ratios that Eric implemented works great.
There is, however, one change from the old implementation that I don’t like.

In the old implementation, when setting axis(‘scaled’) it also turned autoscale off.

This makes sense (and I used it a lot). It means that you can set the axis(‘scaled’), which means the aspect ratios are set equal and the axis limits are not changed, at any point when you like the data limits. The axis limits are then fixed so that every time you add something else to the figure it will keep these limits.

In the new implementation (ok, it has been there for a little while now), you have to give a separate set_autoscale_on(False) command.
Besides the odd name of the function (you actually turn the autoscale off), it is a command that should be set right away by axis(‘scaled’).
If you want the autoscale to remain on, you should use axis(‘equal’)

Anybody else an opinion? Andrea?

Thanks, Mark

Mark Bakker wrote:

The enhanced way of handling aspect ratios that Eric implemented works great.
There is, however, one change from the old implementation that I don't like.

In the old implementation, when setting axis('scaled') it also turned autoscale off.
This makes sense (and I used it a lot). It means that you can set the axis('scaled'), which means the aspect ratios are set equal and the axis limits are not changed, at any point when you like the data limits. The axis limits are then fixed so that every time you add something else to the figure it will keep these limits.

In the new implementation (ok, it has been there for a little while now), you have to give a separate set_autoscale_on(False) command.
Besides the odd name of the function (you actually turn the autoscale off), it is a command that should be set right away by axis('scaled'). If you want the autoscale to remain on, you should use axis('equal')

Here is the present code fragment (slightly mangled by the mailer):

             elif s in ('equal', 'tight', 'scaled', 'normal', 'auto', 'image'):
                 self.set_autoscale_on(True)
                 self.set_aspect('auto')
                 self.autoscale_view()
                 self.apply_aspect()
                 if s=='equal':
                     self.set_aspect('equal', adjustable='datalim')
                 elif s == 'scaled':
                     self.set_aspect('equal', adjustable='box', anchor='C')
                 elif s=='tight':
                     self.autoscale_view(tight=True)
                     self.set_autoscale_on(False)
                 elif s == 'image':
                     self.autoscale_view(tight=True)
                     self.set_autoscale_on(False)
                     self.set_aspect('equal', adjustable='box', anchor='C')

At present, the difference between "equal" and "scaled" is not the autoscale state but the "adjustable".

I don't have any objection to changing the behavior of "scaled" as you suggest, if that is what people want. Alternatively, yet another word could be used to define the behavior you want, and that behavior could be added. I don't find "scaled" or "equal" very descriptive or intuitive; nor do I find that either word suggests how autoscale should be set. (And I agree, "set_autoscale_on(False)" is ugly.)

Eric

Eric -

Yeah, I agree. The words ‘equal’ is confusing. But it was taken from matlab. ‘scaled’ was my invention/doing. I thought it was better than ‘equal’, as it makes the scales equal on both axes. Either way, I would like it if we can fix the data limits in a simple way, and I think incorporating it in ‘scaled’ would be one option. A new option would be a good idea too. Something like ‘scaledfixed’ ? Maybe too long. Or just ‘scaledf’ ? Code is simple:

             elif s == 'scaledf':
                 self.set_aspect('equal', adjustable='box', anchor='C')
                 self.set_autoscale_on(False)

Thanks,

Mark

···

On 1/3/07, Eric Firing <efiring@…202…> wrote:

Mark Bakker wrote:

The enhanced way of handling aspect ratios that Eric implemented works
great.
There is, however, one change from the old implementation that I don’t like.

In the old implementation, when setting axis(‘scaled’) it also turned

autoscale off.
This makes sense (and I used it a lot). It means that you can set the
axis(‘scaled’), which means the aspect ratios are set equal and the axis
limits are not changed, at any point when you like the data limits. The

axis limits are then fixed so that every time you add something else to
the figure it will keep these limits.

In the new implementation (ok, it has been there for a little while
now), you have to give a separate set_autoscale_on(False) command.

Besides the odd name of the function (you actually turn the autoscale
off), it is a command that should be set right away by axis(‘scaled’).
If you want the autoscale to remain on, you should use axis(‘equal’)

Here is the present code fragment (slightly mangled by the mailer):

         elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',

‘image’):
self.set_autoscale_on(True)
self.set_aspect(‘auto’)
self.autoscale_view()
self.apply_aspect()
if s==‘equal’:
self.set_aspect(‘equal’, adjustable=‘datalim’)
elif s == ‘scaled’:
self.set_aspect(‘equal’, adjustable=‘box’, anchor=‘C’)
elif s==‘tight’:

                 self.autoscale_view(tight=True)
                 self.set_autoscale_on(False)
             elif s == 'image':
                 self.autoscale_view(tight=True)
                 self.set_autoscale_on(False)
                 self.set_aspect('equal', adjustable='box', anchor='C')

At present, the difference between “equal” and “scaled” is not the

autoscale state but the “adjustable”.

I don’t have any objection to changing the behavior of “scaled” as you
suggest, if that is what people want. Alternatively, yet another word

could be used to define the behavior you want, and that behavior could
be added. I don’t find “scaled” or “equal” very descriptive or
intuitive; nor do I find that either word suggests how autoscale should

be set. (And I agree, “set_autoscale_on(False)” is ugly.)

Eric

Mark Bakker wrote:

Eric -

Yeah, I agree. The words 'equal' is confusing. But it was taken from matlab. 'scaled' was my invention/doing. I thought it was better than 'equal', as it makes the scales equal on both axes. Either way, I would like it if we can fix the data limits in a simple way, and I think incorporating it in 'scaled' would be one option. A new option would be a good idea too. Something like 'scaledfixed' ? Maybe too long. Or just 'scaledf' ? Code is simple:

                 elif s == 'scaledf':
                     self.set_aspect('equal', adjustable='box', anchor='C')
                     self.set_autoscale_on(False)

No one else said anything about this, so I suspect that you may be the only person using 'scaled' now. Given that you invented it, and that it was present for a while in your original form, I decided to simply restore it to that rather than to introduce another option. There are potentially too many combinations to have a short name for each.

This is not irrevocable, of course.

I had to make a slight change in apply_aspect so that toggling back and forth between this version of scaled and equal would work; I hope that hasn't fouled up anything else. I think it should be OK.

Eric

···

Thanks,

Mark

On 1/3/07, *Eric Firing* <efiring@…202… > <mailto:efiring@…202…>> wrote:

    Mark Bakker wrote:
     > The enhanced way of handling aspect ratios that Eric implemented
    works
     > great.
     > There is, however, one change from the old implementation that I
    don't like.
     >
     > In the old implementation, when setting axis('scaled') it also
    turned
     > autoscale off.
     > This makes sense (and I used it a lot). It means that you can set the
     > axis('scaled'), which means the aspect ratios are set equal and
    the axis
     > limits are not changed, at any point when you like the data
    limits. The
     > axis limits are then fixed so that every time you add something
    else to
     > the figure it will keep these limits.
     >
     > In the new implementation (ok, it has been there for a little while
     > now), you have to give a separate set_autoscale_on(False) command.
     > Besides the odd name of the function (you actually turn the autoscale
     > off), it is a command that should be set right away by
    axis('scaled').
     > If you want the autoscale to remain on, you should use axis('equal')

    Here is the present code fragment (slightly mangled by the mailer):

                 elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',
    'image'):
                     self.set_autoscale_on(True)
                     self.set_aspect('auto')
                     self.autoscale_view()
                     self.apply_aspect()
                     if s=='equal':
                         self.set_aspect('equal', adjustable='datalim')
                     elif s == 'scaled':
                         self.set_aspect('equal', adjustable='box',
    anchor='C')
                     elif s=='tight':
                         self.autoscale_view(tight=True)
                         self.set_autoscale_on(False)
                     elif s == 'image':
                         self.autoscale_view(tight=True)
                         self.set_autoscale_on(False)
                         self.set_aspect('equal', adjustable='box',
    anchor='C')

    At present, the difference between "equal" and "scaled" is not the
    autoscale state but the "adjustable".

    I don't have any objection to changing the behavior of "scaled" as you
    suggest, if that is what people want. Alternatively, yet another word
    could be used to define the behavior you want, and that behavior could
    be added. I don't find "scaled" or "equal" very descriptive or
    intuitive; nor do I find that either word suggests how autoscale should
    be set. (And I agree, "set_autoscale_on(False)" is ugly.)

    Eric

Thanks Eric. I’ll give it a shot,
Mark

···

On 1/6/07, Eric Firing <efiring@…202…> wrote:

Mark Bakker wrote:

Eric -

Yeah, I agree. The words ‘equal’ is confusing. But it was taken from
matlab. ‘scaled’ was my invention/doing. I thought it was better than
‘equal’, as it makes the scales equal on both axes. Either way, I would

like it if we can fix the data limits in a simple way, and I think
incorporating it in ‘scaled’ would be one option. A new option would be
a good idea too. Something like ‘scaledfixed’ ? Maybe too long. Or just

‘scaledf’ ? Code is simple:

             elif s == 'scaledf':
                 self.set_aspect('equal', adjustable='box', anchor='C')

self.set_autoscale_on(False)

No one else said anything about this, so I suspect that you may be the
only person using ‘scaled’ now. Given that you invented it, and that it
was present for a while in your original form, I decided to simply

restore it to that rather than to introduce another option. There are
potentially too many combinations to have a short name for each.

This is not irrevocable, of course.

I had to make a slight change in apply_aspect so that toggling back and

forth between this version of scaled and equal would work; I hope that
hasn’t fouled up anything else. I think it should be OK.

Eric

Thanks,

Mark

On 1/3/07, Eric Firing < > efiring@…202… > > mailto:efiring@...202...> wrote:

Mark Bakker wrote:
 > The enhanced way of handling aspect ratios that Eric implemented
works
 > great.
 > There is, however, one change from the old implementation that I
don't like.
 >
 > In the old implementation, when setting axis('scaled') it also
turned
 > autoscale off.
 > This makes sense (and I used it a lot). It means that you can set the
 > axis('scaled'), which means the aspect ratios are set equal and
the axis
 > limits are not changed, at any point when you like the data
limits. The
 > axis limits are then fixed so that every time you add something
else to
 > the figure it will keep these limits.
 >
 > In the new implementation (ok, it has been there for a little while
 > now), you have to give a separate set_autoscale_on(False) command.
 > Besides the odd name of the function (you actually turn the autoscale
 > off), it is a command that should be set right away by
axis('scaled').
 > If you want the autoscale to remain on, you should use axis('equal')
Here is the present code fragment (slightly mangled by the mailer):

             elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',
'image'):
                 self.set_autoscale_on(True)
                 self.set_aspect('auto')
                 self.autoscale_view()

self.apply_aspect()

                 if s=='equal':
                     self.set_aspect('equal', adjustable='datalim')
                 elif s == 'scaled':
                     self.set_aspect('equal', adjustable='box',
anchor='C')
                 elif s=='tight':
                     self.autoscale_view

(tight=True)

                     self.set_autoscale_on(False)
                 elif s == 'image':
                     self.autoscale_view(tight=True)

self.set_autoscale_on(False)

                     self.set_aspect('equal', adjustable='box',
anchor='C')

At present, the difference between "equal" and "scaled" is not the
autoscale state but the "adjustable".

I don't have any objection to changing the behavior of "scaled" as you
suggest, if that is what people want.  Alternatively, yet another word
could be used to define the behavior you want, and that behavior could
be added.  I don't find "scaled" or "equal" very descriptive or
intuitive; nor do I find that either word suggests how autoscale should
be set.  (And I agree, "set_autoscale_on(False)" is ugly.)

Eric