如何在 LaTeX 中縮放 tikz 圖中的剖面線?

如何在 LaTeX 中縮放 tikz 圖中的剖面線?

我有陰影的橢圓。我想使用線條或磚塊孵化,但比預設的更罕見。

我可以透過這種方式改變線路之間的傳播自訂和內建 TikZ 填滿圖案。它有效,但它太醜了,我不知道如何縮放磚塊。

我嘗試這樣做https://tex.stackexchange.com/a/125545/53834,但這並沒有幫助——孵化適應新的規模。

所以,我的形像是

\documentclass{standalone}    
\usepackage{pgfplots}
\usetikzlibrary{patterns}

\begin{document}
  % defining the new dimensions
  \newlength{\hatchspread}
  \newlength{\hatchthickness}
  % declaring the keys in tikz
  \tikzset{hatchspread/.code={\setlength{\hatchspread}{#1}},
           hatchthickness/.code={\setlength{\hatchthickness}{#1}}}
  % setting the default values
  \tikzset{hatchspread=.5cm,
           hatchthickness=0.4pt}
  % declaring the pattern
  \pgfdeclarepatternformonly[\hatchspread,\hatchthickness]% variables
     {custom north west lines}% name
     {\pgfqpoint{-2\hatchthickness}{-2\hatchthickness}}% lower left corner
     {\pgfqpoint{\dimexpr\hatchspread+2\hatchthickness}{\dimexpr\hatchspread+2\hatchthickness}}% upper right corner
     {\pgfqpoint{\hatchspread}{\hatchspread}}% tile size
     {% shape description
      \pgfsetlinewidth{\hatchthickness}
      \pgfpathmoveto{\pgfqpoint{0pt}{\hatchspread}}
      \pgfpathlineto{\pgfqpoint{\dimexpr\hatchspread+0.15pt}{-0.15pt}}
      \pgfusepath{stroke}
     }
  \begin{tikzpicture}
    \draw[pattern=custom north west lines] (-2,0) ellipse (1cm and 2cm);
    \draw (2,0) ellipse (.7cm and 1.5cm);
  \end{tikzpicture}
\end{document}

我這樣包含它

\begin{figure}[h!]
  \center\includestandalone[width=4cm]{tikz/indistinguishableValuesImage}
\end{figure}

我想為更罕見的孵化獲得更優雅的解決方案,或正常縮放它(使用孵化縮放)。我不想將其設為 PNG——我想使用向量圖形,或者如果沒有什麼幫助的話,使用 SVG。

相關內容