How to properly center TikZ circular arrow

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I want to use the o- arrow in TikZ to highlight certain points in a picture and assign a label to them. Here is an MWE:



documentclassstandalone
usepackagetikz
usetikzlibraryarrows
begindocument

begintikzpicture
node at (0,0) +;
draw[o-,red] (0,0) -- (1,1) node[above] some label;
endtikzpicture

enddocument


it produces following output:



point with label - wrong



However, I want something like this:



point with label - correct



I have achieved the correct solution by using



draw[o-,red, shorten <= -2.3pt] (0,0) -- (1,1) node[above] some label;


which works fine, but, however, this is not a good solution since if I change e.g. the size of the arrowhead or the line width, things break apart and I have to figure out the correct shorten value again. Plus it is not very accurate and it is cumbersome to find the correct shorten value. It would be more practical if the anchor of the o- arrow in Tikz is at the centre of the circle. How can I achieve that?










share|improve this question

























    up vote
    3
    down vote

    favorite












    I want to use the o- arrow in TikZ to highlight certain points in a picture and assign a label to them. Here is an MWE:



    documentclassstandalone
    usepackagetikz
    usetikzlibraryarrows
    begindocument

    begintikzpicture
    node at (0,0) +;
    draw[o-,red] (0,0) -- (1,1) node[above] some label;
    endtikzpicture

    enddocument


    it produces following output:



    point with label - wrong



    However, I want something like this:



    point with label - correct



    I have achieved the correct solution by using



    draw[o-,red, shorten <= -2.3pt] (0,0) -- (1,1) node[above] some label;


    which works fine, but, however, this is not a good solution since if I change e.g. the size of the arrowhead or the line width, things break apart and I have to figure out the correct shorten value again. Plus it is not very accurate and it is cumbersome to find the correct shorten value. It would be more practical if the anchor of the o- arrow in Tikz is at the centre of the circle. How can I achieve that?










    share|improve this question























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I want to use the o- arrow in TikZ to highlight certain points in a picture and assign a label to them. Here is an MWE:



      documentclassstandalone
      usepackagetikz
      usetikzlibraryarrows
      begindocument

      begintikzpicture
      node at (0,0) +;
      draw[o-,red] (0,0) -- (1,1) node[above] some label;
      endtikzpicture

      enddocument


      it produces following output:



      point with label - wrong



      However, I want something like this:



      point with label - correct



      I have achieved the correct solution by using



      draw[o-,red, shorten <= -2.3pt] (0,0) -- (1,1) node[above] some label;


      which works fine, but, however, this is not a good solution since if I change e.g. the size of the arrowhead or the line width, things break apart and I have to figure out the correct shorten value again. Plus it is not very accurate and it is cumbersome to find the correct shorten value. It would be more practical if the anchor of the o- arrow in Tikz is at the centre of the circle. How can I achieve that?










      share|improve this question













      I want to use the o- arrow in TikZ to highlight certain points in a picture and assign a label to them. Here is an MWE:



      documentclassstandalone
      usepackagetikz
      usetikzlibraryarrows
      begindocument

      begintikzpicture
      node at (0,0) +;
      draw[o-,red] (0,0) -- (1,1) node[above] some label;
      endtikzpicture

      enddocument


      it produces following output:



      point with label - wrong



      However, I want something like this:



      point with label - correct



      I have achieved the correct solution by using



      draw[o-,red, shorten <= -2.3pt] (0,0) -- (1,1) node[above] some label;


      which works fine, but, however, this is not a good solution since if I change e.g. the size of the arrowhead or the line width, things break apart and I have to figure out the correct shorten value again. Plus it is not very accurate and it is cumbersome to find the correct shorten value. It would be more practical if the anchor of the o- arrow in Tikz is at the centre of the circle. How can I achieve that?







      tikz-pgf arrows






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      T. Pluess

      1597




      1597




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote













          Peter Grill's answer is the way to go, I'd say. This here is just to show you some options, and also to mention that the arrows library has been superseded by arrows.meta.



          documentclassstandalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node[outer sep=0pt] (plus) at (0,0) +;
          draw[Circle[open,width=width("+"),length=width("+")]-,red,shorten <=-1/2*width("+")] (plus.center) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer




















          • What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
            – T. Pluess
            25 mins ago











          • @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
            – marmot
            21 mins ago










          • sure. I just realized that. It was not obvious at first!
            – T. Pluess
            13 mins ago










          • @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
            – marmot
            9 mins ago

















          up vote
          4
          down vote













          One way would be to not use the o- arrow style and draw the circle with the when you create the node:



          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +


          Here, I have named this node (Plus Sign) so that we can draw the line to this node without having to respecify the coordinate:



          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;


          enter image description here



          Alternatively you could use a pin:



          enter image description here



          Code:



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows
          begindocument

          begintikzpicture
          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +;
          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          Code: pin



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node (Plus Sign) at (0,0) +;
          node [circle, draw=red, inner sep=1pt, pin=[pin edge=red, thin, pin distance=1.4cm, pin position=45, text=red] some label] at (Plus Sign) ;
          endtikzpicture
          enddocument





          share|improve this answer






















          • sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
            – T. Pluess
            40 mins ago










          • @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
            – Peter Grill
            20 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "85"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451830%2fhow-to-properly-center-tikz-circular-arrow%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote













          Peter Grill's answer is the way to go, I'd say. This here is just to show you some options, and also to mention that the arrows library has been superseded by arrows.meta.



          documentclassstandalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node[outer sep=0pt] (plus) at (0,0) +;
          draw[Circle[open,width=width("+"),length=width("+")]-,red,shorten <=-1/2*width("+")] (plus.center) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer




















          • What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
            – T. Pluess
            25 mins ago











          • @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
            – marmot
            21 mins ago










          • sure. I just realized that. It was not obvious at first!
            – T. Pluess
            13 mins ago










          • @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
            – marmot
            9 mins ago














          up vote
          5
          down vote













          Peter Grill's answer is the way to go, I'd say. This here is just to show you some options, and also to mention that the arrows library has been superseded by arrows.meta.



          documentclassstandalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node[outer sep=0pt] (plus) at (0,0) +;
          draw[Circle[open,width=width("+"),length=width("+")]-,red,shorten <=-1/2*width("+")] (plus.center) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer




















          • What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
            – T. Pluess
            25 mins ago











          • @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
            – marmot
            21 mins ago










          • sure. I just realized that. It was not obvious at first!
            – T. Pluess
            13 mins ago










          • @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
            – marmot
            9 mins ago












          up vote
          5
          down vote










          up vote
          5
          down vote









          Peter Grill's answer is the way to go, I'd say. This here is just to show you some options, and also to mention that the arrows library has been superseded by arrows.meta.



          documentclassstandalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node[outer sep=0pt] (plus) at (0,0) +;
          draw[Circle[open,width=width("+"),length=width("+")]-,red,shorten <=-1/2*width("+")] (plus.center) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer












          Peter Grill's answer is the way to go, I'd say. This here is just to show you some options, and also to mention that the arrows library has been superseded by arrows.meta.



          documentclassstandalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node[outer sep=0pt] (plus) at (0,0) +;
          draw[Circle[open,width=width("+"),length=width("+")]-,red,shorten <=-1/2*width("+")] (plus.center) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 28 mins ago









          marmot

          58.9k463126




          58.9k463126











          • What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
            – T. Pluess
            25 mins ago











          • @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
            – marmot
            21 mins ago










          • sure. I just realized that. It was not obvious at first!
            – T. Pluess
            13 mins ago










          • @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
            – marmot
            9 mins ago
















          • What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
            – T. Pluess
            25 mins ago











          • @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
            – marmot
            21 mins ago










          • sure. I just realized that. It was not obvious at first!
            – T. Pluess
            13 mins ago










          • @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
            – marmot
            9 mins ago















          What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
          – T. Pluess
          25 mins ago





          What if there is no node, but only a coordinate where I want to place the circle? like draw[Circle[open]-,red] (0,0) -- (1,1) node[above] some label; and I want the circle to be around coordinate (0,0).
          – T. Pluess
          25 mins ago













          @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
          – marmot
          21 mins ago




          @T.Pluess If you replace (plus.center) by (0,0), you obtain exactly the same picture.
          – marmot
          21 mins ago












          sure. I just realized that. It was not obvious at first!
          – T. Pluess
          13 mins ago




          sure. I just realized that. It was not obvious at first!
          – T. Pluess
          13 mins ago












          @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
          – marmot
          9 mins ago




          @T.Pluess I should perhaps have kept (0,0) but I am a fan of having not too many explicit coordinates around, so I do such things sort of subconsciously. ;-)
          – marmot
          9 mins ago










          up vote
          4
          down vote













          One way would be to not use the o- arrow style and draw the circle with the when you create the node:



          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +


          Here, I have named this node (Plus Sign) so that we can draw the line to this node without having to respecify the coordinate:



          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;


          enter image description here



          Alternatively you could use a pin:



          enter image description here



          Code:



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows
          begindocument

          begintikzpicture
          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +;
          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          Code: pin



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node (Plus Sign) at (0,0) +;
          node [circle, draw=red, inner sep=1pt, pin=[pin edge=red, thin, pin distance=1.4cm, pin position=45, text=red] some label] at (Plus Sign) ;
          endtikzpicture
          enddocument





          share|improve this answer






















          • sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
            – T. Pluess
            40 mins ago










          • @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
            – Peter Grill
            20 mins ago














          up vote
          4
          down vote













          One way would be to not use the o- arrow style and draw the circle with the when you create the node:



          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +


          Here, I have named this node (Plus Sign) so that we can draw the line to this node without having to respecify the coordinate:



          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;


          enter image description here



          Alternatively you could use a pin:



          enter image description here



          Code:



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows
          begindocument

          begintikzpicture
          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +;
          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          Code: pin



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node (Plus Sign) at (0,0) +;
          node [circle, draw=red, inner sep=1pt, pin=[pin edge=red, thin, pin distance=1.4cm, pin position=45, text=red] some label] at (Plus Sign) ;
          endtikzpicture
          enddocument





          share|improve this answer






















          • sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
            – T. Pluess
            40 mins ago










          • @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
            – Peter Grill
            20 mins ago












          up vote
          4
          down vote










          up vote
          4
          down vote









          One way would be to not use the o- arrow style and draw the circle with the when you create the node:



          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +


          Here, I have named this node (Plus Sign) so that we can draw the line to this node without having to respecify the coordinate:



          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;


          enter image description here



          Alternatively you could use a pin:



          enter image description here



          Code:



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows
          begindocument

          begintikzpicture
          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +;
          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          Code: pin



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node (Plus Sign) at (0,0) +;
          node [circle, draw=red, inner sep=1pt, pin=[pin edge=red, thin, pin distance=1.4cm, pin position=45, text=red] some label] at (Plus Sign) ;
          endtikzpicture
          enddocument





          share|improve this answer














          One way would be to not use the o- arrow style and draw the circle with the when you create the node:



          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +


          Here, I have named this node (Plus Sign) so that we can draw the line to this node without having to respecify the coordinate:



          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;


          enter image description here



          Alternatively you could use a pin:



          enter image description here



          Code:



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows
          begindocument

          begintikzpicture
          node [circle, draw=red, inner sep=-1pt] (Plus Sign) at (0,0) +;
          draw[-,red] (Plus Sign) -- (1,1) node[above] some label;
          endtikzpicture

          enddocument


          Code: pin



          documentclass[border=1pt]standalone
          usepackagetikz
          usetikzlibraryarrows.meta
          begindocument

          begintikzpicture
          node (Plus Sign) at (0,0) +;
          node [circle, draw=red, inner sep=1pt, pin=[pin edge=red, thin, pin distance=1.4cm, pin position=45, text=red] some label] at (Plus Sign) ;
          endtikzpicture
          enddocument






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 16 mins ago

























          answered 49 mins ago









          Peter Grill

          160k24425733




          160k24425733











          • sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
            – T. Pluess
            40 mins ago










          • @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
            – Peter Grill
            20 mins ago
















          • sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
            – T. Pluess
            40 mins ago










          • @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
            – Peter Grill
            20 mins ago















          sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
          – T. Pluess
          40 mins ago




          sure, but the plus sign was just an example. Often, I don't have a specific node, but some arbitrary coordinates where I want to put a label.
          – T. Pluess
          40 mins ago












          @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
          – Peter Grill
          20 mins ago




          @T.Pluess: IN that case, I think perhaps you should use a pin instead of an arrow.
          – Peter Grill
          20 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451830%2fhow-to-properly-center-tikz-circular-arrow%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery