[Tutor] inserting degrees symbol in plot title

Steve Willoughby steve at alchemy.com
Wed Aug 10 05:16:59 CEST 2011


On 09-Aug-11 20:11, questions anon wrote:
> I am creating a number of plots of temperature in degrees celsius and I
> would like the title of the plot to have -  C°

> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 19:
> ordinal not in range(128)

Putting the Unicode character in your program is one thing, but what 
library functions you pass that data to is a factor, too.  Without 
knowing anything about matplotlib, my guess from the exception you 
quoted here is that the library is expecting ASCII characters below 128, 
so that function won't accept the special character.


-- 
Steve Willoughby / steve at alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C


More information about the Tutor mailing list