Menu

#299 Precision problem with explicitily anchored labels

v1.0 (example)
closed-invalid
nobody
None
5
2019-12-01
2014-03-05
Ignasi
No

In TeX.SX Label position angle problem question is shown that not all angles are valid as anchors for labels.

A code like:

\documentclass[tikz]{standalone}
\usetikzlibrary{quotes}

\begin{document}
\begin{tikzpicture}[label distance=1cm]
\foreach \x in {0,10,...,360} {
\coordinate["\x:$F$"] (F) at (0,0) {};
\draw[red] (0,0)--++(\x:2cm);}
\end{tikzpicture}
\end{document}

should draw label "F" on angles 0, 10, 20, ... but it produces the result in attached file.

1 Attachments

Discussion

  • Paul Gaborit

    Paul Gaborit - 2014-05-08

    It's not a bug.

    Try this example:

    \documentclass[tikz]{standalone}
    \usetikzlibrary{quotes}
    
    \begin{document}
    \begin{tikzpicture}[label distance=1cm]
      \foreach \x in {0,10,...,360} {
        \typeout{x:\x}
        \edef\x{\x}
        \coordinate["\x:$F$" {draw}] (F) at (0,0);
        \draw[red] (0,0)--++(\x:2cm);
        \fill[blue] (\x:1cm) circle(1pt);
      }
    \end{tikzpicture}
    \end{document}
    

    Then read the pgfmanual p.241 (v3.0).

     
  • Christian Feuersänger

    • status: open --> closed-rejected
     
  • Christian Feuersänger

    Closing based on Paul's comment.

     
  • Ignasi

    Ignasi - 2015-08-03

    I'm sorry but I don't understand how Paul's comment works and how information in page 241 explains it. Its result is just

    http://imgur.com/zaLOmhu

    while I expected 36 labels arround a central node. If you look at http://tex.stackexchange.com/questions/163762/label-position-angle-problem you can find an answer from Mark Wibrow which also suggestes at least a precission problem computing labels positions.

     
    • Paul Gaborit

      Paul Gaborit - 2015-08-03

      Page 241: the automatically choosen anchors for labels are always north, north east, east, etc. or 0°, 45°, 90°, 135°, etc (multiples of 45°). They never are 35° or 73°...

       

      Last edit: Paul Gaborit 2015-08-03
  • Christian Feuersänger

    • status: closed-rejected --> open
     
  • Christian Feuersänger

    Thanks for your fast reaction. I conclude that I was somewhat too fast. I reopened the ticket for investigation.

     
  • Ignasi

    Ignasi - 2015-08-03

    Christian,

    Paul's code works as expected. It was my fault. The figure I attached before was produced with a "spurios" code in my test file. Paul's code produces 36 labels which are anchored on its "nearest to center corner" and not on its center. I understand this is the reason for the wrong aligned for draw=none labels.

     
  • Henri Menke

    Henri Menke - 2018-12-28

    Should have been closed again. Not a bug.

     
  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01
    • status: open --> closed-invalid
     
  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01