4

I would like to draw the Higgs potential field similar to this, using tikz. I don't know how to draw the dots which make the "shade" of potential, does anyone know how to help me?

[edit: I am not asking for the entire code for drawing the potential, as I have an idea on how to do that, but I would like to know only how to generate the shade]

Higgs_example

[edit: So far I have this code:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{tzplot}

\begin{document} \begin{tikzpicture} \tzaxes(-2.5,-1.5)(2.5,5){$x$}{$y$} \tzfn[thick]{(-1.2(\x)^2 +0.4(\x)^4)}[-2.3:2.3]{$V(x)$}[ar] \tzfn[black, ->]{(\x)}[2:-2]{$z$}[ar] \draw[thick, dashed] (1.25,-0.9) arc (0:360:1.25cm and 0.2cm); \draw[thick] (2.15,3) arc (0:360:2.15cm and 0.5cm); \end{tikzpicture} \end{document}

Which produces the following output: enter image description here. I would need help to add the dotted points to give an idea of the shade]

Thanks!

Pleba
  • 69
  • 1
    Draw the axes, draw the curve, draw two ellipses ... that's about it, or not? Please look around on this site for starting code snippets and make more clear where you run into problems. As it is currently written, your question has some "do it for me" flair to it, which is not well received on this site. There is also: https://tex.stackexchange.com/q/95247/47927 – Jasper Habicht May 03 '23 at 00:43
  • Yes sorry, I should have been more specific. I wanted to know how to draw the "shades", would you be able to help me? – Pleba May 03 '23 at 06:57
  • We would help you if you give us a starting point. Some code you wrote, things you tried. Most of the time the answer is a modification of the question. – anis May 03 '23 at 09:01
  • 1
    I edited adding my code – Pleba May 03 '23 at 12:45

1 Answers1

5

You could make use of the fillbetween library provided via PGFPlots:

\documentclass[border=5mm]{standalone}
\usepackage{tzplot, pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}

\begin{document} \begin{tikzpicture} \tzaxes(-2.5,-1.5)(2.5,5){$x$}{$y$} \tzfn[thick, name path=curve]{(-1.2(\x)^2+0.4(\x)^4)}[-2.3:2.3]{$V(x)$}[ar] \tzfn[black, ->]{(\x)}[2:-2]{$z$}[ar] \draw[thick, dashed, name path=bottom] (1.25,-0.9) arc[start angle=0, end angle=360, x radius=1.25cm, y radius=0.2cm]; \draw[thick, name path=top] (2.15,3) arc[start angle=0, end angle=360, x radius=2.15cm, y radius=0.5cm];

    \path[name path=clipped curve, intersection segments={of=top and curve, sequence={R2}}];
    \fill[gray, opacity=0.2, intersection segments={of=clipped curve and bottom, sequence={L1}}] 
        to[out=100, in=180] (0,2.5) 
        arc[start angle=270, end angle=180, x radius=2.15cm, y radius=0.5cm] -- cycle;
    \fill[gray, opacity=0.2, intersection segments={of=clipped curve and bottom, sequence={L5[reverse]}}]
        to[out=80, in=0] (0,2.5) 
        arc[start angle=270, end angle=360, x radius=2.15cm, y radius=0.5cm];
    \fill[gray, opacity=0.4, intersection segments={of=clipped curve and bottom, sequence={L3 -- R3}}] -- cycle;
\end{tikzpicture}

\end{document}

enter image description here


As proposed in the comments, a variation with patterns to imitate the dotted shadings:

\documentclass[border=5mm]{standalone}
\usepackage{tzplot, pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns.meta}

\begin{document} \begin{tikzpicture} \tzaxes(-2.5,-1.5)(2.5,5){$x$}{$y$} \tzfn[thick, name path=curve]{(-1.2(\x)^2+0.4(\x)^4)}[-2.3:2.3]{$V(x)$}[ar] \tzfn[black, ->]{(\x)}[2:-2]{$z$}[ar] \draw[thick, dashed, name path=bottom] (1.25,-0.9) arc[start angle=0, end angle=360, x radius=1.25cm, y radius=0.2cm]; \draw[thick, name path=top] (2.15,3) arc[start angle=0, end angle=360, x radius=2.15cm, y radius=0.5cm];

    \path[name path=clipped curve, intersection segments={of=top and curve, sequence={R2}}];
    \fill[
        pattern={
            Dots[radius=0.4pt, angle=45, distance={2pt/sqrt(2)}]
        }, 
        intersection segments={
            of={clipped curve and bottom}, 
            sequence={L1}
        }
    ] to[out=100, in=180] (0,2.5) 
        arc[start angle=270, end angle=180, x radius=2.15cm, y radius=0.5cm] -- cycle;
    \fill[
        pattern={
            Dots[radius=0.4pt, angle=45, distance={2pt/sqrt(2)}]
        }, 
        intersection segments={
            of={clipped curve and bottom}, 
            sequence={L5[reverse]}
        }
    ] to[out=80, in=0] (0,2.5) 
        arc[start angle=270, end angle=360, x radius=2.15cm, y radius=0.5cm];
    \fill[
        pattern={
            Dots[radius=0.7pt, angle=45, distance={2pt/sqrt(2)}]
        }, 
        intersection segments={
            of={clipped curve and bottom}, 
            sequence={L3 -- R3}
        }
    ] -- cycle;
\end{tikzpicture}

\end{document}

enter image description here

  • 2
    It seems that OP is especially interested in the old-fashioned look of the fills (as stated in the question heading). They can easily be emulated with the patterns.meta tikzlibrary, substituting e. g. gray, opacity=0.2 with pattern={Dots[radius=0.2pt,angle=45,distance={2pt/sqrt(2)}]} and gray, opacity=0.4 with pattern={Dots[radius=0.3pt,angle=45,distance={2pt/sqrt(2)}]} – AlexG May 04 '23 at 13:01
  • You mean something like this: \fill[pattern={Dots[radius=0.2pt,angle=45,distance={2pt/sqrt(2)}]}, intersection segments={of=clipped curve and bottom, sequence={L1}}] ? When I tried it it all turned black – Pleba May 04 '23 at 14:44
  • 1
    @Pleba You need to add \usetikzlibrary{patterns.meta} to the preamble. It should compile fine then. – Jasper Habicht May 04 '23 at 19:55
  • Thank you very much – Pleba May 05 '23 at 07:38