gnuplotdegrees

Inserting degree symbol in gnuplot epslatex


Hi I am using gnuplot epslatex terminal to get my plots. I need a degree symbol, for that I used "{/Symbol \260}". My preamble is as follows

set terminal epslatex standalone newstyle color dashed size 5in,3.5in But ended up with errors. Any suggestions

 Package inputenc Error: Invalid UTF-8 byte "B0.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.169     \gplfronttext
                       
? H
The document does not appear to be in UTF-8 encoding.
Try adding \UseRawInputEncoding as the first line of the file
or specify an encoding such as \usepackage [latin1]{inputenc}
in the document preamble.
Alternatively, save the file in UTF-8 using your editor or another tool

I know the help gave a bunch of commands to fix this. But I have no idea where to paste this. Should I do it in my script itself or any other?

GNUPLOT Version 5.2 patchlevel 8

Lemme know If any further information needs to be provided


Solution

  • All of gnuplot's LaTeX-based terminals use LaTeX for text processing, so any markup or special symbols must be expressed in latex, not in gnuplot's own markup language. On the other hand your output shows that your latex configuration is prepared to handle UTF8 characters so no special symbols or markup is needed. Gnuplot's native text processing and latex should therefore both handle the degree symbol in utf8.

    For example, to add a degree sign to the y axis format:

     set ytics format "%.2f°"
    

    In general for latex numerical output you would want to tell latex to use math mode:

     set ytics format "$%.2f°$"