On Tue, Feb 26, 2013 at 6:02 AM, Pierre Haessig <pierre.haes...@crans.org>wrote:

>  Hi,
>
> Le 26/02/2013 12:38, Gökhan Sever a écrit :
>
>  fp = plt.figure(figsize=(8.5, 11))
>> fp.text(0.5, 0.5, u"Temperature, \u00B0C", color='black', fontsize=16)
>>  plt.savefig('test.ps', papertype='letter')
>> plt.savefig('test.pdf', papertype='letter')
>>
>> Just a thought. Hope it helps.
>>
>> Ryan
>>
>
>  This works fine. However it is easy to remember a superscript o then its
> code :) By the way, can you select the text within the PS file?
>
>
> I just noticed that you are using here the character U+2070 "superscript
> zero" (⁰) while Ryan's proposition is U+00B0 "degree sign" (°) which I
> think is the correct one to use.
>

> This being said, there should be no difference between using the Unicode
> code and actual "°" character (and I agree it's simpler to remember)
>

You are right, U+00B0 is the right one. I think, I couldn't find a
"superscript o" easily then decided to use superscript zero from
http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts

However, there is a slight difference in their appearance when I compare
them side by side.

For simplicity, I just use subscript and superscript unicode symbols to
construct simple units.



>
> In [1]: a = u"Temperature, \u00B0C"
> In [2]: a
> Out[2]: u'Temperature, \xb0C'
>
> In [6]: b = u"Temperature °C"
> In [7]: b
> Out[7]: u'Temperature \xb0C'
>
>
> Coming back to your other question, I can't select the text in the PS file
> (using Okular or Evince). (but PDF is selectable)
>
> Also, the PS file renders properly with both "⁰" and "°" signs. (but with
> PDF, the "⁰" is placed to low, while "°" is fine)
>

Could you test my outputs if they look fine on your side?

http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf
http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps

Thanks.


>
> Best,
> Pierre
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


-- 
Gökhan
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to