填充线属性与边框不同

填充线属性与边框不同

使用此代码,如何使填充线变为实线(不同于边框虚线)

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\frametitle{}
\begin{tikzpicture}
\draw[blue, thin, densely dashed, pattern=north east lines, pattern color=red] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

答案1

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\frametitle{}
\begin{tikzpicture}
\draw[draw=blue, thin, densely dashed,preaction={clip, postaction={pattern=north east lines, pattern color=red}}] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{frame}
\end{document}

相关内容