|
From: Pierre H. <pie...@cr...> - 2013-02-26 13:03:52
|
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 <http://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" (^(0)) 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)
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 "^(0)" and "°" signs. (but
with PDF, the "^(0)" is placed to low, while "°" is fine)
Best,
Pierre
|