LinearLocator

Windows XP SP2 / MPL 0.98 / NumPy 1.1

I wrote some code which has the following line
ax1.yaxis.set_major_locator(MLT.LinearLocator(numticks=10))

I now get the error
AttributeError: LinearLocator instance has no attribute 'verify_intervals'

This was working fine with the previous version of MPL.

Any ideas for a workaround?

This looks like old cruft that did not have any tests and slipped
through the cracks on the upgrade. I'm attaching an updated file you
can drop in site-packages/matplotlib/. We'll fix this on our end so
that the updated version comes out in the bug-fix release. Let us
know if you see any more problems.

BTW: the LinearLocator is prettty old and the default matplotlib tick
locating has gotten a lot better so this is mostly obsolete. My guess
is you will get better results by simply commenting out the linear
locator part.

JDH

ticker.py (36.4 KB)

···

On Mon, Jun 2, 2008 at 11:44 PM, <chuckwhite8@...1845...> wrote:

Windows XP SP2 / MPL 0.98 / NumPy 1.1

I wrote some code which has the following line
ax1.yaxis.set_major_locator(MLT.LinearLocator(numticks=10))

I now get the error
AttributeError: LinearLocator instance has no attribute 'verify_intervals'

This was working fine with the previous version of MPL.

Any ideas for a workaround?

Hi all,
i have a plot on which the x axix has timestamps info; i would like to control the size
of the edge or border (not sure whta is the proper word) so the there is enough space between
the real plot and the outer border so that the x labels are not cut out. I rotate the xlabel also
but still i don't have enough space; how do i control that feature? Even in one of the demo examples
i see the same problem, example in date_demo_convert.py where you can't see the x full lable.

Thank all you much

Margherita

What you are asking for is controlled by the "subplots_adjust" parameter

  fig.subplots_adjust(bottom=0.2)

but for dates in particular we have a helper function which:

  * adjusts the bottom
  * rotates the ticks
  * right aligns them

Try fig.autofmt_xdate() with recent matplotlib releases.

JD

···

On Wed, Jun 4, 2008 at 11:01 AM, Margherita Vittone wiersma <vittone@...1432...> wrote:

Hi all,
i have a plot on which the x axix has timestamps info; i would like to control the size
of the edge or border (not sure whta is the proper word) so the there is enough space between
the real plot and the outer border so that the x labels are not cut out. I rotate the xlabel also
but still i don't have enough space; how do i control that feature? Even in one of the demo examples
i see the same problem, example in date_demo_convert.py where you can't see the x full lable.

Hi Margherita,

Hi all,
i have a plot on which the x axix has timestamps info; i would like to
control the size of the edge or border (not sure whta is the proper word)
so the there is enough space between the real plot and the outer border so
that the x labels are not cut out. I rotate the xlabel also but still i
don't have enough space; how do i control that feature? Even in one of the
demo examples i see the same problem, example in date_demo_convert.py
where you can't see the x full lable.

First of all I cannot confirm your observation with the online version of the
example at
http://matplotlib.sourceforge.net/examples/pylab/date_demo_convert.py

Maybe the function "fig.autofmt_xdate" is not included in your version of the
example.
With that function you have many possibilities to change the x-date-format,
e.g. fig.autofmt_xdate(bottom=0.3, rotation=45)
or you can extend the space between the axes and the border of the figure
yourself using
subplots_adjust(bottom=0.2)

best regards
Matthias

···

On Wednesday 04 June 2008 18:01:47 Margherita Vittone wiersma wrote:

HI , thank you very much for the quick reply, i have an older version (which is not up to me
upgrade) so the subplots_adjust worked just fine. Thanks again.
bye for now
Margherita