
ある時点で 180 度から -180 度にジャンプするという意味において不連続性のあるグラフをプロットしたいと思います。残念ながら、180 度と -180 度の点はつながってしまいます。下の図を参照してください。
(ここまで読んで、私が衛星の地上軌道の緯度経度プロットを作成しようとしていることがお分かりになったかもしれません。)
プロットMWE:
実際のデータでプロット:
どうやって自動的にこれら 2 つの点を結ぶ線を避けるには?
MWE は以下に提供されます。
\documentclass{scrartcl}
\usepackage{mwe}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
ytick={-90,-45,...,90},
xtick={-180,-135,...,180},
axis equal,
grid,
enlargelimits=false,]
\addplot+[mark=,] table {
% A few points read off from above by eye...
87 0
100 75
135 80
180 82
-180 82
-135 75
-90 35
-45 -75
0 -82
45 -75
90 -35
100 0
};
\end{axis}
\end{tikzpicture}
\end{document}
答え1
パスを分割するには、空行を挿入するだけです
\documentclass{scrartcl}
\usepackage{mwe}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
ytick={-90,-45,...,90},
xtick={-180,-135,...,180},
axis equal,
grid,
enlargelimits=false,]
\addplot+[mark=,] table {
% A few points read off from above by eye...
87 0
100 75
135 80
180 82
-180 82
-135 75
-90 35
-45 -75
0 -82
45 -75
90 -35
100 0
};
\end{axis}
\end{tikzpicture}
\end{document}
削除された回答からのHarish Kumarの画像を使用します。