我创建了这个维恩图,我需要在它周围放置一个框作为边框,我该怎么做?
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=3, blend group=screen]
\fill[lightgray] ( 290:.7) circle (1);
\fill[gray] (150:.6) circle (1);
\fill[darkgray] (25:.8) circle (1);
\end{tikzpicture}
\end{document}
答案1
该backgrounds
库提供了一个framed
可以传递给图片的选项:
\documentclass[tikz, border=5pt]{standalone}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[scale=3, blend group=screen, framed]
\fill[lightgray] ( 290:.7) circle (1);
\fill[gray] (150:.6) circle (1);
\fill[darkgray] (25:.8) circle (1);
\end{tikzpicture}
\end{document}
你可以通过改变样式来改变样式background rectangle
。例如,
background rectangle/.style={ultra thick, rounded corners=5pt, draw}
生产
答案2
\documentclass[tikz,border=5]{standalone}
\begin{document}
\begin{tikzpicture}[scale=3, blend group=screen]
\fill[lightgray] ( 290:.7) circle (1);
\fill[gray] (150:.6) circle (1);
\fill[darkgray] (25:.8) circle (1);
\draw[thick] ([shift={(-0.1,-0.1)}]current bounding box.south west) rectangle ([shift={(0.1,0.1)}]current bounding box.north east);
\end{tikzpicture}
\end{document}