河邊的柵欄

河邊的柵欄

怎樣才能做出下面的圖。問題是要造一條河。

在此輸入影像描述

答案1

這是一條隨機河。換\pgfmathsetseed另一條河。

在此輸入影像描述

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
\fill[lime!70!olive](0,0)rectangle(8,4);
\clip(0,0)rectangle(8,4);
\draw[red, very thick, text=black](2,1)--node[above left]{$x$}(2,3)--node[above]{$y$}(6,3)--node[above right]{$x$}(6,1);
\pgfmathsetseed{14159}
\draw[decorate, decoration={random steps, segment length=3mm, amplitude=1pt}, lime!70!black, line width=.5mm, double=cyan!60!white, double distance=1cm](-1,1)--node[above=9mm, text=black]{A}(9,1);
\end{tikzpicture}
\end{document}

相關內容