Skip to content

pgfparse of deg function in a TikZ picture #1002

@teepeemm

Description

@teepeemm

TikZ and PGF provide the deg function, which converts radians into degrees. It is equivalent to having a suffix of r. It appears that we have defined deg in an axis environment, but not just within a TikZ picture.

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}

\begin{document}

\begin{tikzpicture}
\draw(0,1)--(5,5r/60); % works
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[xmax=6,ymax=6]
\addplot(0,1)--(5,{deg(5/60)}); % works
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\draw(0,1)--(5,{deg(5/60)}); % doesn't work
\end{tikzpicture}

\end{document}

This causes Error:pgfparse:pgfparse Parse of 'deg(5/60)' failed

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions