0

I have a graph like

this

Now, I want the inner and half part of the first three eclipses(in asc order) to be dashed. How can I achieve this?

Sample output:

this

Also, I'm using arcs for the curved top and bottom borders. Is there any other simpler way to achieve these slightly curved lines?

Hope I'm clear. Thanks.

2
  • Do you mean an ellipse?
    – egreg
    Commented Jun 22, 2020 at 12:42
  • Oops, my bad!!@egreg Commented Jun 22, 2020 at 12:52

1 Answer 1

2

You can achieve that using dashed arcs. Here is an example:

enter image description here

\documentclass[border=0.5cm]{standalone}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{intersections}


\begin{document}


\begin{tikzpicture}[xscale=1.2,scale=0.6,darkgray]


% Ellipses
\draw[fill=YellowGreen!10,dashed] (0,0) ellipse (1cm and 3cm);
\draw[thick] (90:3) arc(90:270:1cm and 3cm);

\draw[dashed,xshift=3cm] (0,0) ellipse (1.2cm and 4cm);
\draw[thick,xshift=3cm] (90:4) arc(90:270:1.2cm and 4cm);


\draw[dashed,name path=first,xshift=6cm] (0,0) ellipse (1.5cm and 5cm);
\draw[thick,xshift=6cm] (90:5) arc(90:270:1.5cm and 5cm);

\draw[fill=YellowGreen!30,dashed,name path=second,xshift=9cm] (0,0) ellipse (1.7cm and 6cm);
\draw[thick,xshift=9cm] (90:6) arc(90:270:1.7cm and 6cm);

% Intersection of Ellipse 3 and 4
\draw [name intersections={of=first and second},thick]  (intersection-1) to[out=-84, in=84] (intersection-2);
 
 
% Axes
\draw[-latex,thick,BrickRed] (-4,0) -- (13,0) node[right]{$x$};
\draw[-latex,thick,black] (-3,-7) -- (-3,7)node[above]{$y$};
 
\node [BrickRed,fill=white, circle, inner sep=1pt] at (-3,-0.5) {0};
\node[BrickRed] at (0,-0.5) {1};
\node[BrickRed] at (3,-0.5) {2};
\node[BrickRed] at (6,-0.5) {3};
\node[BrickRed] at (9,-0.5) {4};
 
% Green skin
\draw[thick, top color=OliveGreen,
            bottom color=OliveGreen,
            middle color=YellowGreen,fill opacity=0.7] (90:3) arc(90:270:1cm and 3cm) --  (3,-4.05) -- (6,-5.05) -- (9,-6) arc(270:90:1.7cm and 6cm) -- (6,5.05) -- (3,4.05) --cycle ;
\end{tikzpicture}


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .