如何改变“tkzDrawSegments”标记样式?

如何改变“tkzDrawSegments”标记样式?

我需要改变“tkzDrawSegments”标记的厚度、长度以及两个标记之间的分离。

\documentclass{standalone}
\usepackage{tkz-euclide,tikz}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}

%% Coordinates
\tkzDefPoint(0,0){M}
\tkzDefPoint(0:5){A}
\tkzDefPoint(33:2.980908232089868){D}
\tkzDefPoint(81:2.980908232089868){E}
%DRAW
\draw [rounded corners = 0.4, thick, gray!60!black,line width=0.75pt](E) --(M) --(A) --(D)  --cycle;
\tkzDrawSegments[cap=round,line width=0.75pt](D,M M,E)
\tkzMarkSegments[mark=||,color= gray!60!black, size = 4pt, thick,line     width=0.75pt](M,D D,A M,E)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

||您可以使用以下方式修改标记的定义

\def\marksep{1pt}
\def\markwidth{1pt}

% double bar
\pgfdeclareplotmark{||}
{%
  \pgfsetlinewidth{\markwidth}
  \pgfpathmoveto{\pgfqpoint{\marksep}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{\marksep}{-\pgfplotmarksize}}
  \pgfpathmoveto{\pgfqpoint{-\marksep}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{-\marksep}{-\pgfplotmarksize}}
  \pgfusepathqstroke
}

其中\marksep\markwidth控制标记线的间距和厚度

\documentclass{standalone}
\usepackage{tkz-euclide,tikz}
\usetkzobj{all}

\def\marksep{1pt}
\def\markwidth{1pt}

% double bar
\pgfdeclareplotmark{||}
{%
  \pgfsetlinewidth{\markwidth}
  \pgfpathmoveto{\pgfqpoint{\marksep}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{\marksep}{-\pgfplotmarksize}}
  \pgfpathmoveto{\pgfqpoint{-\marksep}{\pgfplotmarksize}}
  \pgfpathlineto{\pgfqpoint{-\marksep}{-\pgfplotmarksize}}
  \pgfusepathqstroke
}



 \begin{document}
    \begin{tikzpicture}

    %% Coordinates
    \tkzDefPoint(0,0){M}
    \tkzDefPoint(0:5){A}
    \tkzDefPoint(33:2.980908232089868){D}
    \tkzDefPoint(81:2.980908232089868){E}
    %DRAW
    \draw [rounded corners = 0.4, thick, gray!60!black,line width=0.75pt](E) --(M) --(A) --(D)  --cycle;
    \tkzDrawSegments[cap=round,line width=0.75pt](D,M M,E)
    \tkzMarkSegments[mark=||,color= gray!60!black, size = 4pt, thick,line     width=.5pt](M,D D,A M,E)
    \end{tikzpicture}
    \end{document} 

相关内容