10

I am trying to reproduce this diagram:

enter image description here

This is my attempt so far using code from Sphere Segments in PGF/TIKZ

enter image description here

Can anyone help make it match my desired result? I'm having trouble getting the perspective correct.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc}
\usepackage{pgfplots}
\usepackage{xxcolor}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{fillbetween}
% Declare nice sphere shading: http://tex.stackexchange.com/a/54239/12440
\pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{0bp}{0bp}}{%
 color(0bp)=(tikz@ball!0!white);
 color(7bp)=(tikz@ball!0!white);
 color(15bp)=(tikz@ball!70!black);
 color(20bp)=(black!70);
 color(30bp)=(black!70)}
\makeatother

% Style to set TikZ camera angle, like PGFPlots `view`
\tikzset{viewport/.style 2 args={
    x={({cos(-#1)*1cm},{sin(-#1)*sin(#2)*1cm})},
    y={({-sin(-#1)*1cm},{cos(-#1)*sin(#2)*1cm})},
    z={(0,{cos(#2)*1cm})}
}}

% Styles to plot only points that are before or behind the sphere.
\pgfplotsset{only foreground/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-0.05:100},
}}
\pgfplotsset{only background/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-100:0.05}
}}

% Automatically plot transparent lines in background and solid lines in foreground
\def\addFGBGplot[#1]#2;{
    \addplot3[#1,only background, opacity=0.25] #2;
    \addplot3[#1,only foreground] #2;
}

\newcommand{\ViewAzimuth}{-10}
\newcommand{\ViewElevation}{55}

\begin{document}
\begin{tikzpicture}[rotate=-90]
    % Compute camera unit vector for calculating depth
    \pgfmathsetmacro{\CameraX}{sin(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraY}{-cos(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraZ}{sin(\ViewElevation)}
    \pgfmathsetmacro{\Radius}{5}
    \pgfmathsetmacro{\DeltaPhi}{10}
    %\path[use as bounding box] (-1.2*\Radius,-1.2*\Radius) rectangle (\Radius,\Radius); % Avoid jittering animation
    % Draw a nice looking sphere
    \begin{scope}
        \clip[name path global=sphere] (0,0) circle (\Radius*1cm);
        \begin{scope}[transform canvas={rotate=-200}]
          %  \shade [ball color=white] (0,0.5*\Radius) ellipse (\Radius*1.8 and
           % \Radius*1.5);
        \end{scope}
    \end{scope}
    \begin{axis}[clip=false,
        hide axis,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        % draw axis by hand
        \draw[dashed] (0,0,0) -- (-1*\Radius,0,0);
        \path[name path=xaxis] (0,0,0) --   (0,pi*\Radius,0);
        \draw[dashed,name intersections={of=xaxis and sphere,by=X}]     
        (0,0,0) --  (X);
        \path[name path=yaxis,draw,dashed] (0,0,0) --   (0,0,1.4*\Radius);
        \draw[dashed,name intersections={of=yaxis and sphere,by=Y}]     
        (0,0,0) --  (Y);
        % Plot the surfaces

        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=7.5*\DeltaPhi:6*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*cos(deg(x))*cos(y)},
            {\Radius*sin(deg(x))*cos(y)}, {\Radius*sin(y)});
        %draw the grand circle and equator  
        \addFGBGplot[domain=0:2*pi, samples=101, samples y=1,smooth,
        domain y=3*\DeltaPhi:5*\DeltaPhi,surf,shader=flat,thick,color=black] 
            ({0},{\Radius*cos(deg(x))}, 
            {\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=101, samples y=1,smooth,
        domain y=3*\DeltaPhi:5*\DeltaPhi,surf,shader=flat,thick,color=black] 
            ({\Radius*cos(deg(x))},
            {\Radius*sin(deg(x))}, {0});
        % continue drawing axes         
        \draw[-latex]   (-\Radius,0,0) --   (-1.1*\Radius,0,0)
        node[left,rotate=90]{$x_3$};
        \draw[-latex]   (X) --  (0,1.1*\Radius,0) coordinate (Xend)
        node[above,rotate=90]{$x_2$};
        \draw[-latex]   (Y) --  (0,0,1.4*\Radius) coordinate (Yend)
        node[above,rotate=90]{$x_1$};

    \end{axis}
\end{tikzpicture}
\end{document}
  • Nice question withe all needed information. Thats good style. +1 – Bobyandbob Oct 21 '19 at 17:21
10

I just permuted the coordinates to get rid of the rotate=90. Thus the azimuth and elevation recover their original meaning. Then an azimuth of 30 and an elevation of 25 seems to come close to your screen shot.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{xxcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

% Style to set TikZ camera angle, like PGFPlots `view`
\tikzset{viewport/.style 2 args={
    x={({cos(-#1)*1cm},{sin(-#1)*sin(#2)*1cm})},
    y={({-sin(-#1)*1cm},{cos(-#1)*sin(#2)*1cm})},
    z={(0,{cos(#2)*1cm})}
}}

% Styles to plot only points that are before or behind the sphere.
\pgfplotsset{only foreground/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-0.05:100},
}}
\pgfplotsset{only background/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-100:0.05}
}}

% Automatically plot transparent lines in background and solid lines in foreground
\def\addFGBGplot[#1]#2;{
    \addplot3[#1,only background, opacity=0.25] #2;
    \addplot3[#1,only foreground] #2;
}

\newcommand{\ViewAzimuth}{30}
\newcommand{\ViewElevation}{25}

\begin{document}
\begin{tikzpicture}[>=stealth]
    % Compute camera unit vector for calculating depth
    \pgfmathsetmacro{\CameraX}{sin(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraY}{-cos(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraZ}{sin(\ViewElevation)}
    \pgfmathsetmacro{\Radius}{5}
    \pgfmathsetmacro{\DeltaPhi}{10}
    \begin{axis}[clip=false,hide axis,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=7.5*\DeltaPhi:9*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
    \begin{axis}[clip=false,hide axis,xshift=12cm,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=7.5*\DeltaPhi:6*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
    \begin{axis}[clip=false,hide axis,xshift=24cm,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=6*\DeltaPhi:5*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Or an azimuth of 40 and an elevation of 15.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{xxcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

% Style to set TikZ camera angle, like PGFPlots `view`
\tikzset{viewport/.style 2 args={
    x={({cos(-#1)*1cm},{sin(-#1)*sin(#2)*1cm})},
    y={({-sin(-#1)*1cm},{cos(-#1)*sin(#2)*1cm})},
    z={(0,{cos(#2)*1cm})}
}}

% Styles to plot only points that are before or behind the sphere.
\pgfplotsset{only foreground/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-0.05:100},
}}
\pgfplotsset{only background/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-100:0.05}
}}

% Automatically plot transparent lines in background and solid lines in foreground
\def\addFGBGplot[#1]#2;{
    \addplot3[#1,only background, opacity=0.25] #2;
    \addplot3[#1,only foreground] #2;
}

\newcommand{\ViewAzimuth}{40}
\newcommand{\ViewElevation}{15}

\begin{document}
\begin{tikzpicture}[>=stealth]
    % Compute camera unit vector for calculating depth
    \pgfmathsetmacro{\CameraX}{sin(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraY}{-cos(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraZ}{sin(\ViewElevation)}
    \pgfmathsetmacro{\Radius}{5}
    \pgfmathsetmacro{\DeltaPhi}{10}
    \begin{axis}[clip=false,hide axis,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=7.5*\DeltaPhi:9*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
    \begin{axis}[clip=false,hide axis,xshift=12cm,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=7.5*\DeltaPhi:6*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
    \begin{axis}[clip=false,hide axis,xshift=24cm,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
    ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \addplot3[only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \draw[thick,->]  (0,0,0) -- (2,0,0) node[right] {$z$};
        \draw[thick,->]  (0,0,0) -- (0,2,0) node[above right] {$x$};
        \draw[thick,->]  (0,0,0) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples y=11,smooth,
        domain y=6*\DeltaPhi:4.5*\DeltaPhi,surf,shader=flat,color=gray,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Only you can decide what looks really good. This answer provides you with means of adjusting the view in the usual way.

ADDENDUM: It seems that wrapping a macro around \addplot can have interesting side effects. Somethings transformations are applied twice. One may then undo the excess transformations unless there is a more systematic way.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{xxcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

% Style to set TikZ camera angle, like PGFPlots `view`
\tikzset{viewport/.style 2 args={
    x={({cos(-#1)*1cm},{sin(-#1)*sin(#2)*1cm})},
    y={({-sin(-#1)*1cm},{cos(-#1)*sin(#2)*1cm})},
    z={(0,{cos(#2)*1cm})}
}}

% Styles to plot only points that are before or behind the sphere.
\pgfplotsset{only foreground/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-0.05:100},
}}
\pgfplotsset{only background/.style={
    restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-100:0.05}
}}

% Automatically plot transparent lines in background and solid lines in foreground
\def\addFGBGplot[#1]#2;{
    \addplot3[#1,only background, opacity=0.25] #2;
    \addplot3[#1,only foreground] #2;
}

\newcommand{\ViewAzimuth}{40}
\newcommand{\ViewElevation}{15}
\newcommand\RingPlot[2][]{
    \begin{axis}[#1,clip=false,hide axis,set layers,
        view={\ViewAzimuth}{\ViewElevation},     % Set view angle
        every axis plot/.style={very thin},
        disabledatascaling,                      % Align PGFPlots coordinates with TikZ
        anchor=origin,                           % Align PGFPlots coordinates with TikZ
        viewport={\ViewAzimuth}{\ViewElevation}, % Align PGFPlots coordinates with TikZ
        ]
        \draw[thick,->]  (\Radius,0,0) -- (\Radius+2,0,0) node[right] {$\theta=0^\circ$};
        \draw[thick,->]  (0,\Radius,0) -- (0,\Radius+2,0) node[above right] {$\phi=0^\circ$};
        \draw[thick,->]  (0,0,\Radius) -- (0,0,\Radius+2) node[above] {$\phi=90^\circ$};
        \draw[thick,->]  (0,0.5,0) -- (0,2,0) node[above right] {$x$};
        \addplot3[mark layer=axis background,on layer=axis background,only marks,mark=cube*,cube/size x=10pt,cube/size y=10pt,cube/size z=10pt] coordinates {(0,0,0)};
        \addplot3[white,thick,domain=0:360] (0.5,{0.3*cos(x)},{0.3*sin(x)});
        \draw[thick,->]  (0.5,0,0) -- (2,0,0) node[right] {$z$};        
        \draw[thick,->]  (0,0,0.5) -- (0,0,2) node[above] {$y$};
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*sin(deg(x))},{\Radius*cos(deg(x))},{0});
        \addplot3[smooth,domain=0:2*pi,thick] 
        ({\Radius*cos(deg(x))},{0},{\Radius*sin(deg(x))});
        \addFGBGplot[domain=0:2*pi, samples=51, samples
        y=11,smooth,shader=interp,point meta=z-0.3*y,colormap/blackwhite,
        #2,surf,opacity=0.6] 
            ({\Radius*sin(y)},
            {\Radius*sin(deg(x))*cos(y)},{\Radius*cos(deg(x))*cos(y)});
     \end{axis}}
\begin{document}
\begin{tikzpicture}[>=stealth]
    % Compute camera unit vector for calculating depth
    \pgfmathsetmacro{\CameraX}{sin(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraY}{-cos(\ViewAzimuth)*cos(\ViewElevation)}
    \pgfmathsetmacro{\CameraZ}{sin(\ViewElevation)}
    \pgfmathsetmacro{\Radius}{5}
    \pgfmathsetmacro{\DeltaPhi}{10}
    \RingPlot{domain y=7.5*\DeltaPhi:9*\DeltaPhi}
    \begin{scope}[xshift=12cm]
    \RingPlot{domain y=6*\DeltaPhi:7.5*\DeltaPhi,xshift=-6cm}
    \end{scope}
    \begin{scope}[xshift=24cm]
    \RingPlot{domain y=4.5*\DeltaPhi:6*\DeltaPhi}
    \end{scope}
\end{tikzpicture}

\end{document}

enter image description here

One would think that one does not need xshift=-6cm in the second plot. But if one omits it, the result is wrong.

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.