On Fri, Mar 26, 2010 at 12:42 PM, konstellationen <konstellatio...@gmail.com
> wrote:

>
> >>You can try:
>
> >>xticklabels = getp(gca(), 'xticklabels')
> >>yticklabels = getp(gca(), 'yticklabels')
> >>setp(xticklabels, fontsize=14, weight='bold')
> >>setp(yticklabels, fontsize=14, weight='bold')
>
> I've tried this, but since I've set  rc('text', usetex=True), the
> ticklabels
> are only responsive to fontsize but not to weight. That is at least my
> experience. Am I doing something wrong?
>
> I've been trying to solve my problem by replacing the ticklabels with
> strings. I know this is a very inelegant workaround, but I am running out
> of
> ideas. I've tried two approaches that haven't worked successfully. (I don't
> get error messages, but nothing changes in the plot):
>
> Approach 1:
> x_labels = ['\boldmath $10^22$','\boldmath $10^23$','\boldmath $10^24$']
> ax1.set_xticklabels(x_labels)
>
> Approach 2:
> Inspired by
> http://old.nabble.com/axis-on-top-for-barh-plot-td26549035.html
> this post :
>
> ax1.xaxis.set_major_locator(ticker.FixedLocator(range(3)))
> ax1.xaxis.set_major_formatter(ticker.FixedFormatter(x_labels))
>


Does it work with:

plt.xticks((10**22, 10**23, 10**24), (r'$10^{22}$', r'$10^{23}$',
r'$10^{24}$'), weight='extra bold')


>
> >>Those are nice looking plots. It would be nice them to be shared on mpl's
> >>gallery or as an example :)
>
> Thanks! I'd be happy to share my code with everyone. It is not very nicely
> written, but I can fix it up. What steps should I take? Everything I've
> learned is from examples. This is just an amalgamation of expressions I've
> found on the web.
>
> Cheers, Daniel
>
>
Just prepare a self-running code, and add some documentation what is it good
for. Later send an e-mail either here or to mpl-devel. Someone with commit
access would be glad to include it in pylab_examples.

-- 
Gökhan
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to