[Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Hi,

In order to get a plot with a small number of ticks, it is possible to
create a matplotlib.ticker.MaxNLocator object with a small value for
`nbins`.

However, I found it also possible to modify the existing AutoLocator
instances, since AutoLocator derives from MaxNLocator :

ax.xaxis.major.locator.set_params(nbins=5)
ax.yaxis.major.locator.set_params(nbins=5)

(the default nbins value seems to be 9)

The advantage of this inplace solution is that it doesn't any
importing/browsing in the mpl namespace. However, it's still a bit long.

I was then wondering :
1) is this solution recommended or not ?
2) is there a shortcup to avoird the five dots ?

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Eric Firing
On 2014/02/17 4:58 AM, Pierre Haessig wrote:
 Hi,

 In order to get a plot with a small number of ticks, it is possible to
 create a matplotlib.ticker.MaxNLocator object with a small value for
 `nbins`.

 However, I found it also possible to modify the existing AutoLocator
 instances, since AutoLocator derives from MaxNLocator :

 ax.xaxis.major.locator.set_params(nbins=5)
 ax.yaxis.major.locator.set_params(nbins=5)

 (the default nbins value seems to be 9)

 The advantage of this inplace solution is that it doesn't any
 importing/browsing in the mpl namespace. However, it's still a bit long.

 I was then wondering :
 1) is this solution recommended or not ?
 2) is there a shortcup to avoird the five dots ?

http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

This is both a pyplot function and an Axes method.

Eric


 best,
 Pierre


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Le 17/02/2014 18:13, Eric Firing a écrit :
  I was then wondering :
  1) is this solution recommended or not ?
  2) is there a shortcup to avoird the five dots ?
 http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

 This is both a pyplot function and an Axes method.
Thanks a lot!

I guess it would be nice to add a back reference to this method in
http://matplotlib.org/api/ticker_api.html

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users