I am creating a number of plots of temperature in degrees celsius and I would like the title of the plot to have - C° <br><div>Through a search I found a way to print the symbol</div><div><br></div><div><div>degree_symbol = unichr(176).encode("latin-1")</div>
<div>print degree_symbol</div></div><div><br></div><div>but when I add this to my plot title I receive a huge error (see below). I have also tried copying (from word) and pasting the symbol into my title (like I did at the beginning of this email) but this also receives a huge error!</div>
<div>Any feedback will be greatly appreciated. </div><div><br></div><div><br></div><div><div>Traceback (most recent call last):</div><div> File "D:\My Dropbox\Python_code\analysis_netcdf_subplots.py", line 75, in <module></div>
<div> plt.show()</div><div> File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 74, in __call__</div><div> manager.show()</div><div> File "C:\Python27\lib\site-packages\matplotlib\backends\backend_wx.py", line 1557, in show</div>
<div> self.canvas.draw()</div><div> File "C:\Python27\lib\site-packages\matplotlib\backends\backend_wxagg.py", line 59, in draw</div><div> FigureCanvasAgg.draw(self)</div><div> File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", line 394, in draw</div>
<div> self.figure.draw(self.renderer)</div><div> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper</div><div> draw(artist, renderer, *args, **kwargs)</div><div> File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 798, in draw</div>
<div> func(*args)</div><div> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper</div><div> draw(artist, renderer, *args, **kwargs)</div><div> File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1946, in draw</div>
<div> a.draw(renderer)</div><div> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper</div><div> draw(artist, renderer, *args, **kwargs)</div><div> File "C:\Python27\lib\site-packages\matplotlib\text.py", line 526, in draw</div>
<div> bbox, info = self._get_layout(renderer)</div><div> File "C:\Python27\lib\site-packages\matplotlib\text.py", line 305, in _get_layout</div><div> clean_line, ismath = self.is_math_text(line)</div><div>
File "C:\Python27\lib\site-packages\matplotlib\text.py", line 989, in is_math_text</div><div> if cbook.is_math_text(s):</div><div> File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 1793, in is_math_text</div>
<div> s = unicode(s)</div><div>UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 19: ordinal not in range(128)</div></div>