Adding symbols to Line Chart axis labels

Hi folks

This is hopefully a quick question about Line Chart manipulation. We’re using ParaView 5.8.1 on Windows 10 x64 bit. We’d like to add the ‘degree’ symbol to an x-axis label, i.e. for degrees Celsius. However, pasting the symbol from MS Word into the viewport’s Axis Title input text field doesn’t work. I was wondering what character set is used for axes labels, and whether there’s an escape sequence for degrees that we can use in pvpython.

Thank you, and our apologies if this is a dum question - we couldn’t find it in the PV Guide
Milan

Using the following works pefectly on Windows 10 x64 with ParaView v5.8.1 binaries.

°C

Hi @mwestphal

Thanks for that! I was actually posting on behalf of a co-worker, I hadn’t tried the copy-and-paste method myself, which does in fact work.

However, using the degree symbol with a pvpython script file does not work on my laptop. The script is as follows, and is run as an external .py file via the Python Shell Panel:
from paraview.simple import
layout1 = GetLayout()
renderView1 = GetActiveViewOrCreate(‘RenderView’)
Delete(renderView1)
del renderView1
lineChartView1 = CreateView(‘XYChartView’)
AssignViewToLayout(view=lineChartView1, layout=layout1, hint=0)
lineChartView1.BottomAxisTitle = ‘Temp (degC)’
lineChartView1.BottomAxisTitle = ‘Temp (°C)’

I get the following error message:
“File “”, line 13
SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xb0 in position 6: invalid start byte” (see attached image)

Pasting the code directly into the Python Shell Panel just ignores the final code line without giving any error message.

Thanks again
Milan
PV581_GUItrace_WinX64_degError.py (353 Bytes)

The following should work.

u"Temp (\N{DEGREE SIGN}C)"

In any case, it would be nice if it was more easy to use and the trace would not be invalid in that case.

1 Like

Thank you for the quick response @mwestphal! It worked like a charm.
(it seems we don’t need the ‘u’ prefix to the string, which makes it even better)

Yes, the u is implicit.