.png)
(질문은 그리 길지 않고 이미지와 코드 예제가 많습니다.)
다음과 같은 두 개의 독립 항목을 병합하려고 합니다 tikzpictures
.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,math}
\usetikzlibrary{shapes.misc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pgfplotsset{my style/.append style={clip = false, axis lines* = middle, axis equal, xtick = \empty, ytick = \empty, xmin=-1, ymin=-1}}
\begin{document}
% First picture
\begin{tikzpicture}
\begin{axis}[my style]
\addplot [green, fill, fill opacity=0.2, domain=0:360, samples=40] ({1+cos(x)*0.8},{1+sin(x)*0.8});
\end{axis}
\end{tikzpicture}
%Second picture
\begin{tikzpicture}
\begin{axis}[my style]
\addplot [red] coordinates {(1,1)(0,0)};
\end{axis}
\end{tikzpicture}
\end{document}
각각의 원래 좌표를 보존합니다. 그리고 나는 마치 내가 하는 것처럼 동일한 그림을 얻기 위해 두 가지를 병합할 수 있기를 원합니다.
\begin{tikzpicture}
\begin{axis}[my style]
\addplot [green, fill, fill opacity=0.2, domain=0:360, samples=40] ({1+cos(x)*0.8},{1+sin(x)*0.8});
\addplot [red] coordinates {(1,1)(0,0)};
\end{axis}
\end{tikzpicture}
("그럼 그렇게 하세요"라고 대답하지 마세요. 두 개의 독립적인 tikzpictures에서 해당 결과를 얻고 싶습니다.)
따라서 원본 사진은 다음과 같습니다.
예상되는 결과는 다음과 같습니다.
나는 읽었습니다:
하지만 내 문제에 맞는 유일한 것은 이 댓글이라고 생각합니다.https://tex.stackexchange.com/a/96900/222098. 나는 그 해결책을 이런 식으로 시도했습니다.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,math}
\usetikzlibrary{shapes.misc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pgfplotsset{my style/.append style={clip = false, axis lines* = middle, axis equal, xtick = \empty, ytick = \empty, xmin=-1, ymin=-1}}
\begin{document}
\begin{tikzpicture}
\node [] at (0,0){
\begin{tikzpicture}
\begin{axis}[my style]
\addplot [green, fill, fill opacity=0.2, domain=0:360, samples=40] ({1+cos(x)*0.8},{1+sin(x)*0.8});
\end{axis}
\end{tikzpicture}
};
\node [] at (0,0){
\begin{tikzpicture}
\begin{axis}[my style]
\addplot [red] coordinates {(1,1)(0,0)};
\end{axis}
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}
결과는 다음과 같습니다.
그러나 해당 솔루션은 원래 좌표를 유지하지 않습니다(그리고 수동으로 수행할 필요가 없는 것을 선호합니다). 사진 중 하나가 새로 병합된 사진에서 올바른 좌표계 축척을 갖고 있지 않은 것 같습니다.