14

Here is my code.

\resizebox{\textwidth}{!}{
\begin{tikzpicture}
\selectcolormodel{gray}
\begin{axis}[xlabel=Voltage,ylabel=Current,title=IV Characteristics of PV Module]
\node[label={Set 1}] at (axis cs:2,60){};
\node[label=Set 2] at (axis cs:2,150){};
\node[label=Set 3] at (axis cs:2,240){};
\node[label=Set 4] at (axis cs:2,305){};
\addplot table [x=v1,y=i1, col sep=comma,mark=none] {SolarCellIV.csv};
\addplot table [x=v2,y=i2, col sep=comma,mark=none] {SolarCellIV.csv};
\addplot table [x=v3,y=i3, col sep=comma,mark=none] {SolarCellIV.csv};
\addplot table [x=v4,y=i4, col sep=comma,mark=none] {SolarCellIV.csv};
\node at (axis cs:12,360) {Set 1: 44.9 degreeCelsius};
\end{axis}
\end{tikzpicture}}

I want the symbol for Degree Celsius in place of the text. How do I do so?

1
  • 2
    Pls include complete (\begin document, \end document, \usepackage...) otherwise we can't run your code.
    – vaettchen
    Commented Aug 2, 2015 at 5:53

5 Answers 5

18

Just use \textdegree{}C

Attention, you need to say \usepackage{textcomp} in your document's preamble.

2
  • Forces OP to give up initial aim of having "no command layer between input and semantics". See my explanation of WYSIWYM vs WYSIWYG
    – user152148
    Commented Jan 23, 2019 at 2:08
  • @JonWong if having "no command layer between input and semantics" is your personal aim, don't use tex
    – user177954
    Commented Jan 23, 2019 at 13:29
23

Here are two other options:

$44.9^\circ$C
\SI{44.9}{\celsius} % \usepackage{siunitx}

I prefer the second one (if siunitx is used anyway).

3
  • \celsius is enough for siunitx and you do not need math mode.
    – MaxNoe
    Commented Aug 2, 2015 at 12:59
  • I liked the first one better. One less package to load helps speeding up execution times when you are dealing with big projects.
    – ivbc
    Commented Mar 4, 2018 at 15:30
  • For those caring about consistency, there does not seem to be the equivalent \fahrenheit in siunitx. And, as with all units, your first solution probably needs an \, (half-space) between the number and unit Commented Jul 15, 2020 at 19:29
3

Most is said already, but it's worth mentioning, that $^\circ$ and \textdegree{} yield different symbols: circ vs textdegree

So either

\usepackage{textcomp}
44.9 \textcelsius{}

or

\usepackage{siunitx}
\SI{44.9}{\celsius}

or if the exact typesetting is not important, this works as well:

$44.9\, ^\circ$C

If the curly brackets are omitted after \textdegree{} the space behind is ignored. \textdegree\ does the same job.

0

similar to @sergej, for using the siunitx package,

I use \SI{4.9}{\degreeCelsius}

or you can also use \usepackage{textcomp} and \textcelsius

0

I use the amsmath package and use it like this (replace 25 and C with whatever you need):

$25^\text{o}C

This is what it looks like:

25oC

I think it looks a lot like a real degree symbol, and it's fairly simple.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .