Arrow between two nodes in two different tikzpictures - latex

I have a tikzpicture where I use two def blocks to define two unique figures. I want to draw an arrow between two nodes and each of them locate in each def block. There are IDs assigned to each node, but the arrow I get is not what I want.
\usetikzlibrary{shapes}
\usetikzlibrary{math}
\def\clusterone{%
\begin{tikzpicture}[scale=1.0]
\foreach \radius [count=\angleCount from 0] in {0.2, 0.6, 0.4, 0.5}
{\node[draw=green, circle, inner sep=0pt, minimum size=2pt, fill=green] (c1-\angleCount) at ({\radius * cos(90 * \angleCount)}, {\radius * sin(90 * \angleCount)}) {};}
\end{tikzpicture}%
}
\def\clustertwo{%
\begin{tikzpicture}[scale=1.0]
\foreach \radius [count=\angleCount from 0] in {0.6, 0.1, 0.4, 0.6}
{\node[draw=green, circle, inner sep=0pt, minimum size=2pt, fill=green] (c2-\angleCount) at ({\radius * cos(90 * \angleCount)}, {\radius * sin(90 * \angleCount)}) {};}
\end{tikzpicture}%
}
\scalebox{1}{
\begin{tikzpicture}
\node[rotate=30] (node1) at (0, 1.5) {\clusterone};
\node[] at (0, 1.5) {1};
\node[rotate=30] (node2) at (0, 0) {\clustertwo};
\node[] at (0, 0) {2};
\draw[->] (c1-0) -- (c2-3);
\end{tikzpicture}
}
Expected
Current Result
Is there a way to address IDs of two nodes that are located inside two different tikzpictures? Or is there a way to draw an arrow between nodes in this situation?

Don't nest tikz pictures!
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{math}
\begin{document}
\def\clusterone{%
\foreach \radius [count=\angleCount from 0] in {0.2, 0.6, 0.4, 0.5}
{\node[draw=green, circle, inner sep=0pt, minimum size=2pt, fill=green] (c1-\angleCount) at ({\radius * cos(90 * \angleCount)}, {\radius * sin(90 * \angleCount)}) {};}
}
\def\clustertwo{%
\foreach \radius [count=\angleCount from 0] in {0.6, 0.1, 0.4, 0.6}
{\node[draw=green, circle, inner sep=0pt, minimum size=2pt, fill=green] (c2-\angleCount) at ({\radius * cos(90 * \angleCount)}, {\radius * sin(90 * \angleCount)}) {};}
}
\begin{tikzpicture}
\begin{scope}[yshift=1.5cm]
\clusterone
\end{scope}
\node[] at (0, 1.5) {1};
\begin{scope}
\clustertwo
\end{scope}
\node[] at (0, 0) {2};
\draw[->] (c1-0) -- (c2-3);
\end{tikzpicture}
\end{document}

Related

adjust labels on tikz bar chart

How can I adjust the labels on the y-axis?
In the current version, the labels are not aligned to the bars.
The example is from:
https://texample.net/tikz/examples/bar-chart/
I add a few more data fields and removed the second category.
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[title = Contributions per category
at LaTeX-Community.org,
xbar,
y axis line style = { opacity = 0 },
axis x line = none,
tickwidth = 0pt,
enlarge y limits = 0.2,
enlarge x limits = 0.02,
symbolic y coords = {test1,test2,test3,test4,LaTeX, Tools, Distributions, Editors},
nodes near coords,
]
\addplot coordinates { (57727,LaTeX) (5672,Tools)
(2193,Distributions) (11106,Editors)
(11106,test1)
(11106,test2)
(11106,test3)
(11106,test4)
};
\legend{Topics}
\end{axis}
\end{tikzpicture}
\end{document}
With the ytick=data option:
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
title = Contributions per category at LaTeX-Community.org,
xbar,
y axis line style = { opacity = 0 },
axis x line = none,
tickwidth = 0pt,
enlarge y limits = 0.2,
enlarge x limits = 0.02,
symbolic y coords = {test1,test2,test3,test4,LaTeX,Tools,Distributions,Editors},
ytick=data,
nodes near coords,
nodes near coords align={horizontal},
]
\addplot coordinates {
(57727,LaTeX)
(5672,Tools)
(2193,Distributions)
(11106,Editors)
(11106,test1)
(11106,test2)
(11106,test3)
(11106,test4)
};
\legend{Topics}
\end{axis}
\end{tikzpicture}
\end{document}

TikZ code for bandwidth segmentation: display problem

I would like to illustrate graphically a bandwidth segmentizer. To do so, I would like to represent the following diagram in TikZ
So far, I have the following LaTeX code
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage{amsmath, amssymb, mathtools}
\usepackage{physics}
\newcounter{cnt}\setcounter{cnt}{0}
\begin{document}
\tikzset{str_to_vec/.style = {rectangle, draw, minimum width=3cm, text centered}}
\tikzset{modulus2/.style = {rectangle, draw, text centered}}
\tikzset{thresh/.style = {rectangle, draw, text centered}}
\tikzset{dottedline/.style = {ultra thick, loosely dotted,shorten >=1mm, shorten <=1mm}}
\begin{tikzpicture}[>=latex]
\node[rectangle, draw] (RX) at (0, 0) {Rx};
\node[
rectangle,
draw,
minimum height=3cm,
text width=1.8cm,
text centered
]
(PFB_CHANNELIZER) at ($(RX) + (3, 0)$)
{PFB\\ Channelizer};
\draw[->]
(RX)
--
(
$(PFB_CHANNELIZER.north west)
!0.5!
(PFB_CHANNELIZER.south west)$
);
\foreach \i in {0.15, 0.35}
{
\draw[->]
(
$(PFB_CHANNELIZER.north east)
!\i!
(PFB_CHANNELIZER.south east)$
)
coordinate (PFB_\thecnt)
to
++(1.5, 0)
coordinate (STR_TO_VEC_\thecnt)
node[str_to_vec, anchor=west] {stream to vector};
\draw[->]
(STR_TO_VEC_\thecnt.east)
to
++(5, 0)
coordinate (MODULUS2_\thecnt)
node[modulus2, anchor=west] {$\norm{\cdot}^2$};
\draw[->]
(MODULUS2_\thecnt.east)
to
++(5, 0)
coordinate (THRESHOLD_\thecnt)
node[thresh, anchor=west] {threshold};
\stepcounter{cnt}
}
\draw[->]
(
$(PFB_CHANNELIZER.north east)
!0.85!
(PFB_CHANNELIZER.south east)$
)
coordinate (PFB_3)
to
++(1.5, 0)
coordinate (STR_TO_VEC_3)
node[str_to_vec, anchor=west] {stream to vector};
\draw[->]
(STR_TO_VEC_3.east)
to
++(5, 0)
coordinate (MODULUS2_3)
node[modulus2, anchor=west] {$\norm{\cdot}^2$};
\draw[->]
(MODULUS2_3.east)
to
++(5, 0)
coordinate (THRESHOLD_3)
node[thresh, anchor=west] {threshold};
\draw[dottedline]
(STR_TO_VEC_1.south)
--
(STR_TO_VEC_3.north);
\draw[dottedline]
(MODULUS2_1.south)
--
(MODULUS2_3.north);
\end{tikzpicture}
\end{document}
which produces a strange output
(probably because of the anchor=west) options, and I do not know how to do without these. Can someone help me out ?
Thank you and have a nice day, Alex
The problem is that you are drawing your arrows from the previous arrow and not from the previous node. If you add a name to your nodes instead (foo in the example below), the new arrow won't be drawn over the old node:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage{amsmath, amssymb, mathtools}
\usepackage{physics}
\newcounter{cnt}\setcounter{cnt}{0}
\begin{document}
\tikzset{str_to_vec/.style = {rectangle, draw, minimum width=3cm, text centered}}
\tikzset{modulus2/.style = {rectangle, draw, text centered}}
\tikzset{thresh/.style = {rectangle, draw, text centered}}
\tikzset{dottedline/.style = {ultra thick, loosely dotted,shorten >=1mm, shorten <=1mm}}
\begin{tikzpicture}[>=latex]
\draw[->]
(0,0)
to
++(5, 0)
coordinate (MODULUS2_3)
node[modulus2, anchor=west] (foo) {$\norm{\cdot}^2$};
\draw[->]
(foo)
to
++(5, 0)
coordinate (THRESHOLD_3)
node[thresh, anchor=west] {threshold};
\end{tikzpicture}
\end{document}
Thanks to the answer of #samcarter_is_at_topanswers.xyz, the code delivering good results reads
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage{amsmath, amssymb, mathtools}
\usepackage{physics}
\newcounter{cnt}\setcounter{cnt}{0}
\begin{document}
\tikzset{str_to_vec/.style = {rectangle, draw, minimum width=3cm, text centered}}
\tikzset{modulus2/.style = {rectangle, draw, text centered}}
\tikzset{thresh/.style = {rectangle, draw, text centered}}
\tikzset{dottedline/.style = {ultra thick, loosely dotted,shorten >=1mm, shorten <=1mm}}
\begin{tikzpicture}[>=latex]
%===========
% NODES
%===========
\node[rectangle, draw] (RX) at (0, 0) {Rx};
\node[
rectangle,
draw,
minimum height=3cm,
text width=1.8cm,
text centered
]
(PFB_CHANNELIZER) at ($(RX) + (3, 0)$)
{PFB\\ Channelizer};
% %=================
% % CONNECTIONS
% %=================
\draw[->]
(RX)
--
(
$(PFB_CHANNELIZER.north west)
!0.5!
(PFB_CHANNELIZER.south west)$
);
\foreach \i in {0.15, 0.35}
{
\draw[->]
(
$(PFB_CHANNELIZER.north east)
!\i!
(PFB_CHANNELIZER.south east)$
)
coordinate (PFB_\thecnt)
to
++(1.5, 0)
node[str_to_vec, anchor=west] (STR_TO_VEC_\thecnt) {stream to vector};
\draw[->]
(STR_TO_VEC_\thecnt.east)
to
++(1.5, 0)
node[modulus2, anchor=west] (MODULUS2_\thecnt) {$\norm{\cdot}^2$};
\draw[->]
(MODULUS2_\thecnt.east)
to
++(1.5, 0)
node[thresh, anchor=west] (THRESHOLD_\thecnt) {threshold};
\stepcounter{cnt}
}
\draw[->]
(
$(PFB_CHANNELIZER.north east)
!0.85!
(PFB_CHANNELIZER.south east)$
)
coordinate (PFB_3)
to
++(1.5, 0)
node[str_to_vec, anchor=west] (STR_TO_VEC_3) {stream to vector};
\draw[->]
(STR_TO_VEC_3.east)
to
++(1.5, 0)
node[modulus2, anchor=west] (MODULUS2_3) {$\norm{\cdot}^2$};
\draw[->]
(MODULUS2_3.east)
to
++(1.5, 0)
node[thresh, anchor=west] (THRESHOLD_3) {threshold};
\draw[dottedline]
(STR_TO_VEC_1.south)
--
(STR_TO_VEC_3.north);
\draw[dottedline]
(MODULUS2_1.south)
--
(MODULUS2_3.north);
\draw[dottedline]
(THRESHOLD_1.south)
--
(THRESHOLD_3.north);
\end{tikzpicture}
\end{document}

Remove white space on right side of pgfplot

Currently I have the following figures (plots):
I have placed the pgfplots inside two subfigures such that I can add the captions. The problem however is that some white space is added on the right side of Figure 3b. I am using the \hfill option but still this white space is note removed. Does someone know how to get rid of this white space such that the righthandside of Figure 3b alligns with the borders of my paper (represented by text text text ...)
My code is as follows:
\documentclass[a4paper, 11pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage[margin=2.5cm]{geometry}
\usepackage{subcaption}
\usepackage{float}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{font=\footnotesize}
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}{0.49\textwidth}
\begin{tikzpicture}
\begin{axis}[
title={},
xlabel={Epochs},
ylabel={Rewards},
ylabel near ticks,
legend pos=south east,
ymajorgrids=true,
grid style=densely dotted,
width=7cm,
height=6cm,
legend cell align={left},
legend style={font=\footnotesize}
]
\addplot[color = black, line width = 0.25mm, mark = *, mark size = 1] coordinates {
(1, 1.5)(2, 1.3)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {1.4}; % Constant line
\legend{Plot1,}
\end{axis}
\begin{axis}[
ylabel={Percentage (\%)},
axis y line*=right,
ylabel near ticks,
ylabel style={rotate=-180},
hide x axis,
width=7cm,
height=6cm,
legend style={font=\footnotesize}
]
\addplot[color = black, mark = *, mark size = 1] coordinates {
(1, 0.5)(2, 0.6)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {0.53}; % Constant line
\legend{Plot2,}
\end{axis}
\end{tikzpicture}
\caption{Performance}
\label{Plot:}
\end{subfigure}\hfill
\begin{subfigure}{0.49\textwidth}
\begin{tikzpicture}
\begin{axis}[
title={},
xlabel={Epochs},
ylabel={Rewards},
ylabel near ticks,
legend pos=south east,
ymajorgrids=true,
grid style=densely dotted,
width=7cm,
height=6cm,
legend cell align={left},
legend style={font=\footnotesize}
]
\addplot[color = black, line width = 0.25mm, mark = *, mark size = 1] coordinates {
(1, 1.5)(2, 1.3)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {1.4}; % Constant line
\legend{Plot1,}
\end{axis}
\end{tikzpicture}
\caption{Action distribution}
\label{Plot:}
\end{subfigure}
\caption{Results}
\label{Plot:}
\end{figure}
\end{document}
The problem is that your plots are about 7 cm wide and you place them in a subfigure of .49\textwidth, so the \hfill you place between the subfigures only sees the objects of .49\textwidth and add fill space according to this. If you want to move the plot towards the right boarder, you could
a) place the \hfill into the subfigure (the caption won't be centred anymore)
b) adjust the .49\textwidth to match the actual width of the plot (something around 7 cm)
(the \fbox{...} in the code below is just to visualize the size of the plots)
\documentclass[a4paper, 11pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage[margin=2.5cm,showframe]{geometry}
\usepackage{subcaption}
\usepackage{float}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{font=\footnotesize}
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}{0.49\textwidth}
\fbox{\begin{tikzpicture}
\begin{axis}[
title={},
xlabel={Epochs},
ylabel={Rewards},
ylabel near ticks,
legend pos=south east,
ymajorgrids=true,
grid style=densely dotted,
width=7cm,
height=6cm,
legend cell align={left},
legend style={font=\footnotesize}
]
\addplot[color = black, line width = 0.25mm, mark = *, mark size = 1] coordinates {
(1, 1.5)(2, 1.3)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {1.4}; % Constant line
\legend{Plot1,}
\end{axis}
\begin{axis}[
ylabel={Percentage (\%)},
axis y line*=right,
ylabel near ticks,
ylabel style={rotate=-180},
hide x axis,
width=7cm,
height=6cm,
legend style={font=\footnotesize}
]
\addplot[color = black, mark = *, mark size = 1] coordinates {
(1, 0.5)(2, 0.6)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {0.53}; % Constant line
\legend{Plot2,}
\end{axis}
\end{tikzpicture}}
\caption{Performance}
\label{Plot:}
\end{subfigure}
\begin{subfigure}{0.49\textwidth}
\hfill%
\fbox{\begin{tikzpicture}
\begin{axis}[
title={},
xlabel={Epochs},
ylabel={Rewards},
ylabel near ticks,
legend pos=south east,
ymajorgrids=true,
grid style=densely dotted,
width=7cm,
height=6cm,
legend cell align={left},
legend style={font=\footnotesize}
]
\addplot[color = black, line width = 0.25mm, mark = *, mark size = 1] coordinates {
(1, 1.5)(2, 1.3)
};
\addplot[color = black, line width = 0.25mm, mark = none, samples = 2, dashed] {1.4}; % Constant line
\legend{Plot1,}
\end{axis}
\end{tikzpicture}}%
\caption{Action distribution}
\label{Plot:}
\end{subfigure}
\caption{Results}
\label{Plot:}
\end{figure}
\end{document}

Avoid vertical line at the end of data (LaTeX pgfplots)

I'd like to draw a line plot the years on the x-axis with xmax = 2020 in LateX pgfplots. As my data ends in 2019 I get a vertical line at 2019. It's probably quite easy but I didn't find anything about how to avoid that.
Thanks in advance!
Example code:
\documentclass[tikz, border=1mm]{standalone}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
width = 0.6\textwidth,
xticklabel style=
{/pgf/number format/1000 sep=,rotate=90,anchor=east},
xmin = 1995, xmax = 2020,
ymin = 0, ymax = 1.2,
xlabel = Year,
ylabel style ={align=center}, ylabel = Specific energy consumption\\in kWh/pkm,
yticklabels={, 0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2}]
\addplot [] coordinates {
(1995,1.102) (1996,1.067) (1997,1.048) (1998,0.939) (1999,0.905) (2000,0.901) (2001,0.924) (2002,0.944) (2003,0.906) (2004,0.9) (2005,0.901) (2006,0.89) (2007,0.854) (2008,0.829) (2009,0.813) (2010,0.839) (2011,0.846) (2012,0.831) (2013,0.772) (2014,0.768) (2015,0.785) (2016,0.794) (2017,0.765) (2018,0.755) (2019,0.768) } \closedcycle;
\end{axis}
\end{tikzpicture}
\end{figure}
With \closedcycle you explicitly add the line
\documentclass[tikz, border=1mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
width = 0.6\textwidth,
xticklabel style=
{/pgf/number format/1000 sep=,rotate=90,anchor=east},
xmin = 1995, xmax = 2020,
ymin = 0, ymax = 1.2,
xlabel = Year,
ylabel style ={align=center}, ylabel = Specific energy consumption\\in kWh/pkm,
yticklabels={, 0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2}]
\addplot [] coordinates {
(1995,1.102) (1996,1.067) (1997,1.048) (1998,0.939) (1999,0.905) (2000,0.901) (2001,0.924) (2002,0.944) (2003,0.906) (2004,0.9) (2005,0.901) (2006,0.89) (2007,0.854) (2008,0.829) (2009,0.813) (2010,0.839) (2011,0.846) (2012,0.831) (2013,0.772) (2014,0.768) (2015,0.785) (2016,0.794) (2017,0.765) (2018,0.755) (2019,0.768) }
% \closedcycle
;
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}

How to Find Intersections with Ellipses in PGF/TikZ

I am trying to display a sphere in PGF/TikZ to illustrate the idea of great circles.
The code for my current result is:
\begin{tikzpicture}
\tikzfading[name=fade right,
left color=transparent!20,
right color=transparent!90]
\tikzfading[name=fade out,
inner color=transparent!100,
outer color=transparent!10]
\tikzfading[name=fade right gc,
left color=transparent!0,
right color=transparent!70]
\draw [<->, dashed] (0,-5) -- (0,5); % y-axis
\draw [->, dashed] (0, 0) -- (20:5); % x-axis
\draw [->, dashed] (0, 0) -- (200:5); % x-axis
\draw [->, dashed] (0, 0) -- (340:5); % z-axis
\draw [->, dashed] (0, 0) -- (160:5); % z-axis
\fill [color=cyan, opacity=0.15, path fading=fade out] (0,0) circle (4cm); % bounding circle
\fill [color=cyan, opacity=0.25, path fading=fade right, fading angle=90] (0,0) ellipse (4cm and 1cm); % x-y-axis area
% great circle 1
\draw [rotate=-40, color=red, path fading=fade right gc, fading angle=40] (0,0) ellipse (4cm and 1cm);
% great circle 2
\draw[rotate=5, color=red, path fading=fade right gc, fading angle=5] (0,0) ellipse (1.5cm and 4cm);
\end{tikzpicture}
How do I
find the two points of intersection of the two red ellipses (commented as great circle 1 and 2),
find the point of intersection of a line (originating at the center (0,0)) with a ellipse, and
place a little circle or rectangle there?
Placing a little circle or rectangle there is not an issue.
Thank you very much!
Check out section 4.1.4. of the TikZ and PGF manual, titled "The Intersection of the Circles." You need to use the intersections library, which allows you to use the name intersections key, as in \path [name intersections={of=path 1 and path 2}] ;. To use this, you'll need to use the name path key, as in \draw [name path = y axis, <->, dashed] (0,-5) -- (0,5) ; % y-axis. Accessing the intersections seems to vary between versions; my local copy of the manual has different instructions from the one I linked you to. However, at least on my version, you then access the intersections with (intersection-1), (intersection-2), etc. To get circles at each intersection in your example, then, I would change your code to look like the following:
\begin{tikzpicture}
\tikzfading[ name = fade right
, left color = transparent!20
, right color = transparent!90 ]
\tikzfading[name = fade out
, inner color = transparent!100
, outer color = transparent!10 ]
\tikzfading[name = fade right gc
, left color = transparent!0
, right color = transparent!70]
\draw [name path = y axis, <->, dashed] (0,-5) -- (0,5) ; % y-axis
\draw [name path = x- axis, ->, dashed] (0, 0) -- (20:5) ; % x-axis
\draw [name path = x+ axis, ->, dashed] (0, 0) -- (200:5) ; % x-axis
\draw [name path = z+ axis, ->, dashed] (0, 0) -- (340:5) ; % z-axis
\draw [name path = z- axis, ->, dashed] (0, 0) -- (160:5) ; % z-axis
% bounding circle
\fill [color=cyan, opacity=0.15, path fading=fade out]
(0,0) circle (4cm) ;
% x-y-axis area
\fill [color=cyan, opacity=0.25, path fading=fade right, fading angle=90]
(0,0) ellipse (4cm and 1cm);
% great circle 1
\draw [ name path = great circle 1
, rotate = -40
, color = red
, path fading = fade right gc
, fading angle = 40]
(0,0) ellipse (4cm and 1cm);
% great circle 2
\draw [ name path = great circle 2
, rotate = 5
, color = red
, path fading = fade right gc
, fading angle = 5]
(0,0) ellipse (1.5cm and 4cm);
% Intersections
\path [name intersections={of=great circle 1 and great circle 2}] ;
\foreach \i in {1,...,4}
\fill [color=red] (intersection-\i) circle (2pt) ;
\path [name intersections={of=y axis and great circle 1}] ;
\fill (intersection-1) circle (2pt) ;
\fill (intersection-2) circle (2pt) ;
\path [name intersections={of=y axis and great circle 2}] ;
\fill (intersection-1) circle (2pt) ;
\fill (intersection-2) circle (2pt) ;
\foreach \a in {x,z} {
\foreach \ss in {+,-} {
\def\s.{\ss} % Otherwise the space in `\a\s axis` would get gobbled.
\path [name intersections={of=\a\s. axis and great circle 1}] ;
\fill (intersection-1) circle (2pt) ;
\path [name intersections={of=\a\s. axis and great circle 2}] ;
\fill (intersection-1) circle (2pt) ;
}
}
\end{tikzpicture}
Other than the reformatting (to avoid the horizontal scroll bar), all I have changed of your existing code is to add the name path key to your axes and great circles. I then added the intersections code, which should be relatively self-explanatory. Remember to \usetikzlibrary{intersections} first, and everything should work.

Resources