Since the only real problem with the siunitx
solution is the clash of names, it's simple enough to just create duplicate versions of the siunitx
commands so that the semantics match the content:
\documentclass{article}
\usepackage{siunitx}
\let\DeclareUSUnit\DeclareSIUnit
\let\US\SI
\DeclareUSUnit\inch{in}
\begin{document}
\US{1}{\inch} is \SI{2.54}{\cm}
\end{document}
As John said, you can remove the points by using the key no markers
in the polaraxis
options (or in the \addplot
options if you only want to remove the marks for a single plot).
For moving the tick marks out the axis, you can put the following code snippet in your preamble, which will make sure that the labels are placed properly regardless of the axis rotation (\pgftransform@angle
is a key that is set whenever rotate=<angle>
is called):
\makeatletter
\def\pgftransform@angle{0}
\pgfplotsset{
xticklabel style={
inner xsep=1pt,
ellipse,
anchor=\tick-(180-\pgftransform@angle)
},
yticklabel style={
anchor=\pgftransform@angle
}
}
\makeatother
For the degree symbol, you can use the approach from your other question (Polar plots, add degree symbol and hide the radius axis labels), as Christian mentioned.
![](https://i.stack.imgur.com/B3dXQ.png)
(And the same axis with rotate=35
)
![](https://i.stack.imgur.com/UifET.png)
\documentclass[10pt,border=10pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\usetikzlibrary{shapes.geometric}
\makeatletter
\def\pgftransform@angle{0}
\pgfplotsset{
xticklabel style={
inner xsep=1pt,
ellipse,
anchor=\tick-(180-\pgftransform@angle)
},
yticklabel style={
anchor=\pgftransform@angle
}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[xmin=-90,xmax=90,rotate=90,
domain=-90:90,
xticklabel=$\pgfmathprintnumber{\tick}^\circ$,
no markers]
\addplot +[orange, thick, smooth] {cos(x)};
\end{polaraxis}
\end{tikzpicture}
\end{document}
Best Answer
The
siunitx
package provides two macros that address your typesetting needs:\si
and\SI
.\si
lets you typeset scientific units in ways that satisfy basic SI typographic formatting conventions, and\SI
lets you typeset numbers and their associated scientific units.For more information on how scientific units should be typeset according to the Système Inernational (SI) conventions, please see the NIST's SI Unit rules and style conventions.
Addendum to pick up on @leandriis's follow-up comment: The
siunitx
package provides the abbreviations\fg
,\pg
,\ng
,\ug
,\mg
,\g
and\kg
for -- you guessed it -- femtogram, picogram, nanogram, microgram, milligram, gram, and kilogram. See the multi-page Table 21 of package's user guide for the full details.