如何在 TikZ 中更改箭头大小和比例?

如何在 TikZ 中更改箭头大小和比例?

我一直在研究这个数字,但遇到了一些问题。

  1. 我怎样才能改变箭头的大小?
  2. 如何将零置于垂直线正下方?
  3. 我如何改变图形的比例?

    \documentclass[a4paper,oneside,article]{memoir}
    \usepackage[utf8]{inputenc}
    \usepackage[danish]{babel}
    \usepackage{babel}
    \usepackage{pgf,tikz}
    \usepackage{tikzscale}
    \usetikzlibrary{angles,calc,intersections,quotes,arrows}
    \usepackage{tkz-euclide}
    \usetkzobj{all}
    \usepackage{mathrsfs}
    \usetikzlibrary{babel}
    \begin{document}
    
    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
    \draw[<->,color=black] (-1.5,0.) -- (1.5,0.);
    \foreach \x in {-1.,1.}
    \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
    \draw[->,color=black] (0.,0) -- (0.,3.5);
    
    \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
    \clip(-1.5,-1.5) rectangle (6.5,3.5);
    \draw (-1.,3.14159)-- (-1.,0.);
    \draw (-1.,0.)-- (1.,0.);
    \draw (1.,0.)-- (1.,3.14159);
    \draw (-1.,3.14159)-- (1.,3.14159);
    \draw (2.05,-0.95)-- (5.92,2.92);
    \draw (2.34,1.7)-- (4.98,0.17);
    \draw(3.5,1.5) circle (1.cm);
    \draw [<->] (3.5,1.5) -- (3.933479957929779,2.401163207234515);
    \draw [<->] (1.3,1.5) -- (2.2,1.5);
    \begin{scriptsize}
    \draw [fill=black] (0.5,0.7854) circle (1.5pt);
    \draw[color=black] (0.48297257459254965,0.96005462744924652) node {$(p_2,\alpha _2)$};
    \draw [fill=black] (-0.3,2.6179) circle (1.5pt);
    
    \draw[color=black] (-0.490091064358716,2.8276333241269166) node {$(p_1,\alpha _1)$};
    
    \draw[color=black] (-1.3379064613731417,3.14159) node {$\pi$};
    \draw[color=black] (5.8,2) node {$T(p_2,\alpha _2)$};
    \draw[color=black] (5.2,0.4451160520474517) node {$T(p_1,\alpha _1)$};
    \draw [fill=black] (3.5,1.5) circle (1.5pt);
    \draw[color=black] (3.6514466357055486,2) node {$1$};
    \draw[color=black] (2.6676305320562292,2.611406719382492) node {$b(o,1)$};
    \draw[color=black] (3.3163103462895014,1.5897712463899266) node {$o$};
    \end{scriptsize}
    \end{tikzpicture}
    \end{document}
    

在此处输入图片描述

答案1

您可以在加载较新的库后使用来更改箭头的大小arrows.meta,例如>={Stealth[inset=0pt,length=8pt,angle'=28,round]}。在这里,您可以更改箭头尖的类型及其长度/插入/角度/圆形/等。

要将零点置于垂直线正下方,请执行\draw (0pt,-2pt) node[below] {\footnotesize $0$};,其中和(0pt,-2pt)处于同一水平,并且 分别在其右侧和左侧。1-1

要更改图形的比例,您只需说scale=<ratio>而不是x=<>y=<>。此外,还有xscale=<>yscale=<>可以分别进行水平或垂直缩放。

最后,删除全部draw=black,而不仅仅fill=black使用fill,黑色是默认的。

\documentclass[a4paper,oneside,article]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage{babel}
\usepackage{pgf,tikz}
\usepackage{tikzscale}
\usetikzlibrary{angles,calc,intersections,quotes,arrows.meta}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{mathrsfs}
\usetikzlibrary{babel}
\begin{document}

\begin{tikzpicture}[line cap=round,line join=round,>={Stealth[inset=0pt,length=8pt,angle'=28,round]},scale=1.5]
\draw[<->] (-1.5,0.) -- (1.5,0.);
\foreach \x in {-1.,1.}
\draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->] (0.,0) -- (0.,3.5);

\draw (0pt,-2pt) node[below] {\footnotesize $0$};
\clip (-1.5,-1.5) rectangle (6.5,3.5);
\draw (-1.,3.14159)-- (-1.,0.);
\draw (-1.,0.)-- (1.,0.);
\draw (1.,0.)-- (1.,3.14159);
\draw (-1.,3.14159)-- (1.,3.14159);
\draw (2.05,-0.95)-- (5.92,2.92);
\draw (2.34,1.7)-- (4.98,0.17);
\draw(3.5,1.5) circle (1.cm);
\draw [<->] (3.5,1.5) -- (3.933479957929779,2.401163207234515);
\draw [<->] (1.3,1.5) -- (2.2,1.5);
\begin{scriptsize}
\draw [fill] (0.5,0.7854) circle (1.5pt);
\draw (0.48297257459254965,0.96005462744924652) node {$(p_2,\alpha _2)$};
\draw [fill] (-0.3,2.6179) circle (1.5pt);

\draw (-0.490091064358716,2.8276333241269166) node {$(p_1,\alpha _1)$};

\draw (-1.3379064613731417,3.14159) node {$\pi$};
\draw (5.8,2) node {$T(p_2,\alpha _2)$};
\draw (5.2,0.4451160520474517) node {$T(p_1,\alpha _1)$};
\draw [fill] (3.5,1.5) circle (1.5pt);
\draw (3.6514466357055486,2) node {$1$};
\draw (2.6676305320562292,2.611406719382492) node {$b(o,1)$};
\draw (3.3163103462895014,1.5897712463899266) node {$o$};
\end{scriptsize}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容