Consider the following picture:


I would like to draw this picture using LaTeX (preferably PSTricks but TikZ is also fine).

The space between the two curves should be completely yellow.

P.S. I know that this is a "please do it for me" question (sorry for that!) but I really don't know how to draw this at all.

  • @CroCo Did you even read the question? He even explains himself. Sep 11 '17 at 1:39
  • @CroCo And the OP is being picky about application and colouring. If you have no clue how to do it why would you care whether it is pstricks, MetaPost or picture?
    – cfr
    Sep 11 '17 at 1:39
  • 1
    @cfr Sometimes you just get stuck and don't know where to start, see this question of mine. I agree that the phrasing could be improved though. Sep 11 '17 at 1:42
  • 1
    @HenriMenke So why do you close all the newbies' questions? Only high rep users are allowed to get stuck? I think there is something to be said for being more tolerant of do-it-for-mes from new users than established users. But, apparently, you think the right to not have a clue has to be earned by accumulating points by having a clue what to do, which seems like catch-22 for beginners.
    – cfr
    Sep 11 '17 at 1:54
  • 1
    @cfr, when some people like posts, they will search for any excuses to not downvote or close a post, something like He even explains himself. :)
    – CroCo
    Sep 11 '17 at 2:11

I think this comes somewhat close.


  \draw[double=yellow,double distance=2pt,line join=round,looseness=3]
  -- (1,0)
  to[out=70,in=-10,looseness=1] (.5,.5)
  to[out=10,in=-10] (.25,.75)
  to[out=10,in=0] (0,1)
  to[out=180,in=170] (-.25,.75)
  to[out=190,in=170] (-.5,.5)
  to[out=190,in=120,looseness=1] (-1,0)
  -- cycle;


enter image description here

  • This looks really nice. Thank you very much! Sep 11 '17 at 1:43
  • 1
    @SvendTveskæg It's not pstricks though. I don't know how to draw a connected \ncarc to get the rounded corners. Maybe you find a way to convert it. Sep 11 '17 at 1:52

Just for fun, with pstricks 😉

I feel there ought to be (surely) an easier way of continuing an arc from the previous point, but I couldn't find it.

\def\lstxy{!CP \csname tx@UserCoor\endcsname}
  \psarcn[#1](\lstxy exch #3 cos #2 mul sub exch #3 sin #2 mul sub){#2}{#3}{#4}
\foreach \lnwd/\lncl in {30pt/black, 25pt/yellow}{
    \psline(0,0)(!220 cos 5 mul 220 cos 2 mul add 0)

enter image description here




enter image description here

  • Very elegant. If I compile the code (using xelatex), a piece of the figure is missing at the bottom left corner. Sep 11 '17 at 14:33
  • 1
    Oh, the arrows=c-c was missing in \pscustom
    – user2478
    Sep 11 '17 at 14:47

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.