7

Hello i'm trying to get the arrows on the circles

enter image description here

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-all}
\begin{document}
\begin{pspicture}(-4,-4)(4,4)\grilla
\psaxes[linewidth=1.2pt,labels=none,
ticks=none]{-}(0,0)(-4,-4)(4,4)
\pscircle[linewidth=1.1pt](0,0){1}
\pscircle[linewidth=1.1pt](0,0){2}
\pscircle[linewidth=1.1pt](0,0){3}
\rput[c](4,0.2){$x$}
\rput[c](0.2,3.8){$y$}
\end{pspicture}

\end{document}
  • 1
    Your code does not compile. What is \grilla? – Phelype Oleinik Jan 11 '18 at 15:41
  • \grilla is grid... \newpsobject{grilla}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt} – ChuckTesta Jan 11 '18 at 16:39
6
\documentclass{article}
\usepackage{pst-plot}
\begin{document}

\begin{pspicture}(-4,-4.5)(4,4.5)
\psaxes[labels=none,ticks=none]{->}(0,0)(-4,-4)(4,4)[$x$,0][$y$,90]
\psset{arrowscale=1.5}
\multido{\n=1+1}{3}{%
  \psarcn[linewidth=1.1pt]{>->}(0,0){\n}{45}{225}
  \psarc[linewidth=1.1pt](0,0){\n}{30}{230}}
\end{pspicture}

\end{document}

enter image description here

  • Do you know why the radii of arcs and circles get treated differently? – user121799 Jan 11 '18 at 16:33
  • I cannot see that behaviour – user2478 Jan 11 '18 at 16:37
  • Please have a look at my example below and compile it with ` \psarc[linewidth=1.1pt]{<-}(0,0){\n}{45}{90}` instead of ` \psarc[linewidth=1.1pt]{<-}(0,0){\rad}{45}{90}. (I had to reduce the radii of the arcs by 1.1pt` in order to have them sit on the circles.) – user121799 Jan 11 '18 at 17:03
  • @marmot: What do you mean "the radii of arcs and circles get treated differently"? They are different in what? You can play with dimen to avoid such a difference. – Money Oriented Programmer Jan 11 '18 at 18:58
  • 1
    @marmot: use dimen=middle for the circle – user2478 Jan 11 '18 at 19:17
6

Also with tikz:

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,bending}

\begin{document}
    \begin{tikzpicture}[>=latex,line width=.7pt]
    \draw (-3.2,0)--(3.2,0)node[right]{$x$} (0,-3.2)--(0,3.2)node[above]{$y$};
    \foreach \r in {1,2,3} 
      \draw[
      decoration={markings, mark=at position 0.125 with {\arrow{<}}},
      decoration={markings, mark=at position 0.625 with {\arrow{<}}},
      postaction={decorate}
      ]
      (0,0) circle (\r);
    \end{tikzpicture}
\end{document}

enter image description here

6

Thanks to Herbert, there is a very simple solution:

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-all}
\begin{document}
\begin{pspicture}(-4,-4)(4,4)%\grilla
\psaxes[linewidth=1.2pt,labels=none,
ticks=none]{-}(0,0)(-4,-4)(4,4)
\multido{\n=1+1}{3}{
    \pscircle[dimen=middle,linewidth=1.1pt](0,0){\n}
    \psarc[linewidth=1.1pt]{<-}(0,0){\n}{45}{90}
    \psarc[linewidth=1.1pt]{<-}(0,0){\n}{225}{270}}

\rput[c](4,0.2){$x$}
\rput[c](0.2,3.8){$y$}
\end{pspicture}
\end{document}

The dimen=middle is required since otherwise the radii of the arcs and circles disagree.

enter image description here

If the aim is to really reproduce the arrows from your picture, you may also use

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-all}
\begin{document}
\begin{pspicture}(-4,-4)(4,4)%\grilla
\psaxes[linewidth=1.2pt,labels=none,
ticks=none]{-}(0,0)(-4,-4)(4,4)
\def\mytriangle{\begin{pspicture}(-0.2,-0.2)(0.2,0.2)
\pspolygon[fillstyle=solid,fillcolor=black](-0.2,0.2)(0.2,0.2)(0,-0.2)
\end{pspicture}
}

\multido{\n=1+1}{3}{
    \pscircle[linewidth=1.1pt](0,0){\n}
    \pstFPmul\rad{\n}{0.707107} % 0.707107 = 1/sqrt(2)
    \rput[c]{45}(\rad,\rad){\mytriangle}
    \rput[c]{225}(-\rad,-\rad){\mytriangle}
    }

\rput[c](4,0.2){$x$}
\rput[c](0.2,3.8){$y$}
\end{pspicture}

\end{document}

enter image description here

I'd be very interested to learn to reproduce the nice curved arrows that come with the feynmp package (curved fermion lines) with either pstricks or tikZ.

UPDATE Using AboAmmar's solution and this answer, one can may bend the arrows.

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,bending,arrows.meta,calc}

\begin{document}
    \begin{tikzpicture}[>=latex,line width=.7pt]
    \draw (-3.2,0)--(3.2,0)node[right]{$x$} (0,-3.2)--(0,3.2)node[above]{$y$};
    \foreach \r in {1,2,3} 
      {\draw      (0,0) circle (\r);
    \draw[-{Stealth[length=0.3cm,bend]}]  (90:\r) arc (90:45:\r);
    \draw[-{Stealth[length=0.3cm,bend]}]  (270:\r) arc (270:225:\r);}
    \end{tikzpicture}
\end{document}

enter image description here

  • @ArtificialStupidity I know and it produced a weird output, please try yourself. (It skipped one circle.) – user121799 Jan 11 '18 at 18:57
  • @ArtificialStupidity That's a matter of taste. Unlike TikZ, pstricks is perfectly fine with nested picture environments, and my command can also be called outside the picture, – user121799 Jan 11 '18 at 19:10
  • As I said in my comment to Herbert's answer, play with dimen. Anyway, dimen=m is enough. Thanks to me. :-) – Money Oriented Programmer Jan 11 '18 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.