2

I want to draw a diagram attached in the image below. I have been able to design some part as follows

\documentclass{article}
 \usepackage{tikz}
  \usetikzlibrary{decorations.text,calc,arrows.meta}
   \begin{document}
   \begin{tikzpicture}



    \begin{scope}[xshift=6cm]
     \coordinate (O) at (0,0);
      \draw[fill=red!30] (O) circle (2.8);
      \draw[fill=green!40] (O) circle (2);



   \draw[decoration={text along path,reverse path,text align={align=center},text= 
 {Haha}},decorate] (0.5,0) arc (0:180:0.5);
   \draw[decoration={text along path,reverse path,text align={align=center},text=. 
 {Text}},decorate] (1.3,0) arc (0:180:1.3);
   \draw[decoration={text along path,reverse path,text align={align=center},text={Should be 
    here any!}},decorate] (2.1,0) arc (0:180:2.1);
  \draw[decoration={text along path,reverse path,text align={align=center},text={Hello, how 
   are you?}},decorate] (2.9,0) arc (0:180:2.9);
    \end{scope}

   \end{tikzpicture}
   \end{document}

4

Maybe I am missing something but getting something reminiscent of the drawing is as simple as

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{fit,positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}
 \node (XYZ) {XYZ};
 \node[right=1em of XYZ] (ABC) {ABC};
 \node[ellipse,draw,thick,fit=(XYZ)(ABC),label=30:DEF,
 append after command={(\tikzlastnode.north) edge[thick,bend left=20] (\tikzlastnode.south)}]{};
\end{tikzpicture}
\end{document}

enter image description here

If you want to have a symmetric node even if the node texts are not equally wide, you can use

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,fit,positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}
 \node (XYZ) {XYZ};
 \node[right=1em of XYZ] (ABC) {ABCDE};
 \path ($(XYZ.east)!0.5!(ABC.west)$) coordinate (M) let \p1=($(M)-(XYZ.west)$),
  \p2=($(ABC.east)-(M)$),\p3=($(XYZ.north)-(XYZ.south)$),
  \p4=($(ABC.north)-(ABC.south)$), \n1={max(\x1,\x2)},\n2={max(\y3,\y4)/2} in
    ([xshift=-\n1,yshift=\n2]M) coordinate (aux1)
    ([xshift=-\n1,yshift=-\n2]M) coordinate (aux2)
    ([xshift=\n1,yshift=\n2]M) coordinate (aux3)
    ([xshift=\n1,yshift=-\n2]M) coordinate (aux4)
 node[ellipse,draw,thick,fit=(aux1)(aux2)(aux3)(aux3),label=30:DEF,
 append after command={(\tikzlastnode.north) edge[thick,bend left=20] (\tikzlastnode.south)}]{};
\end{tikzpicture}
\end{document}

enter image description here

You can also do an asymmetric version.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{fit,intersections,positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}
 \node (XYZ) {XYZ};
 \node[right=1em of XYZ] (ABC) {ABCDEFGH};
 \path (XYZ) -- (ABC) coordinate[midway](aux);
 \node[name path=elli,ellipse,draw,thick,fit=(XYZ)(ABC),label=30:DEF](F){};
 \path[name path=vert] (aux|-F.north) -- (aux|-F.south);
 \draw[thick,name intersections={of=elli and vert}] 
  (intersection-1) to[bend left=20] (intersection-2);
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • Something like this. Diagram which is like egg shaped and center line is need to be curvy. Thanks for the diagram. – nice guy Jun 8 at 6:08
  • 2
    @niceguy I bent the line in the middle. – user194703 Jun 8 at 6:10
  • Instead of wrting ABC if I write ABCDEFGH then it is overlapping with the bending line in the first part of the code. – nice guy Jun 8 at 6:39
  • 2
    @niceguy Not with the second code. – user194703 Jun 8 at 6:40
  • Is it possible to reduce the streching that one gets after adding a text inside the shape? – nice guy Jun 20 at 5:44

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.