Re: [Matplotlib-users] how to put colorbar label beside the handle?

2012-12-04 Thread ChaoYue
Hi, 

rather than the previous manual definition of the text postioins, I find a
more general/decent way:

yloc=(cbar.values-cbar.boundaries[0])/(cbar.boundaries[-1]-cbar.boundaries[0])
for l,y in zip(cbar_label,yloc):
cbar.ax.text(1,y,l,transform=cbar.ax.transAxes,ha='left',va='center')

Chao



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/how-to-put-colorbar-label-beside-the-handle-tp39705p39941.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hiding axis

2012-12-04 Thread Vilson Vieira
2012/12/4 Pierre Haessig 

> I just edited your file :
> https://gist.github.com/4203760
>
> I made 2 changes:
>  * added a call to random.seed to make you code reproductible.
>  * altered the call to set_clip_on(False). It should be called on the
> Line2D object returned by plot()
>
> I think it solves your clipping problem.
>

Pierre, it works perfectly! Thank you so much.

All the best.

-- 
Vilson Vieira

vil...@void.cc

((( http://automata.cc )))

((( http://musa.cc )))

((( http://labmacambira.sourceforge.net )))
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Noob Q's: Filling, and centring bars in a bar chart, centring xticks and positioning text against a log y axis

2012-12-04 Thread Tristan Strange
On 4 December 2012 17:20, Goyo  wrote:

> 2012/12/4 Tristan Strange :
> > - I'd like each of the ticks on the x axis centred beneath each of the
> bars.
> exp(0.1 + np.log(y))
> I'm not sure I understand this. align=center might be what you want.


This is exactly what I was after.


>
> > - I'd like numbers in normal integer form not 10 to power form on the y
> > axis.
>
> I'm sure it can be done but I'm unable to help. Are you sure you want
> so many zeros in the Y tick labels?
>

Think you're right there actually.


> Also the calls to xticks() and plot() are useless. Check this code:
> http://pastebin.com/ELNV9Bea


This is  exactly what I was after many thanks.

Cheers,
Tristan
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Noob Q's: Filling, and centring bars in a bar chart, centring xticks and positioning text against a log y axis

2012-12-04 Thread Goyo
2012/12/4 Tristan Strange :
> Hi all,
>
> I'm just getting started with matplotlib and am having a few problems
> producing a simple bar graph. The code I'm writing to produce this can be
> found here: http://pastebin.com/T0WA2dh8
>
> The issues I'm having are as follows:
>
> - The bars in my graph do not show as filled blue after I make the the y
> axis logarithmic. How do I stop this from occurring.

Set the y scale before calling bar().

> - Each bar needs "centring" - they are arranged to the left of where I'd
> like them to be currently.
> - I'd like each of the ticks on the x axis centred beneath each of the bars.
exp(0.1 + np.log(y))
I'm not sure I understand this. align=center might be what you want.

> - I'm struggling to position text neatly above each of the bars - I've
> managed to position text well horizontally but not vertically. The log scale
> is making it hard for me to work out where to position them.

If you write the text at y+k, then you'll see it log(y+k)-log(y) above
the bar in the logarithmic plot. So if you want to see it h above the
bar you have to write it at exp(h + log(y)).

> - I'd like numbers in normal integer form not 10 to power form on the y
> axis.

I'm sure it can be done but I'm unable to help. Are you sure you want
so many zeros in the Y tick labels?

> Also how do I label each axis?
xlabel(), ylabel()

Also the calls to xticks() and plot() are useless. Check this code:
http://pastebin.com/ELNV9Bea


> Any help offered will be very much appreciated.
>
> Cheers,
> Tristan
>
> --
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Noob Q's: Filling, and centring bars in a bar chart, centring xticks and positioning text against a log y axis

2012-12-04 Thread Tristan Strange
Hi all,

I'm just getting started with matplotlib and am having a few problems
producing a simple bar graph. The code I'm writing to produce this can be
found here: http://pastebin.com/T0WA2dh8

The issues I'm having are as follows:

- The bars in my graph do not show as filled blue after I make the the y
axis logarithmic. How do I stop this from occurring.

- Each bar needs "centring" - they are arranged to the left of where I'd
like them to be currently.

- I'd like each of the ticks on the x axis centred beneath each of the bars.

- I'm struggling to position text neatly above each of the bars -
I've managed to position text well horizontally but not vertically. The log
scale is making it hard for me to work out where to position them.

- I'd like numbers in normal integer form not 10 to power form on the y
axis.

Also how do I label each axis?

Any help offered will be very much appreciated.

Cheers,
Tristan
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hiding axis

2012-12-04 Thread Pierre Haessig
Hi,

Le 29/11/2012 20:42, Vilson Vieira a écrit :
> I tried the no_clip function but it didn't worked:
> https://gist.github.com/4171341

I just edited your file :
https://gist.github.com/4203760

I made 2 changes:
 * added a call to random.seed to make you code reproductible.
 * altered the call to set_clip_on(False). It should be called on the
Line2D object returned by plot()

I think it solves your clipping problem.

Best,
Pierre




signature.asc
Description: OpenPGP digital signature
--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users