tikz 新手:创建一个新的坐标系以与 Euclide tikz 包一起使用

tikz 新手:创建一个新的坐标系以与 Euclide tikz 包一起使用

我想使用 Euclide Tikz 包绘制一些描述几何应用,但首先,我需要一个新的 X、Y 和 Z 坐标系(见附图)。Euclide Tikz 提供的默认坐标系对我没有帮助。有人能帮我提供附图中坐标系的代码吗?

在此处输入图片描述

答案1

朴素的Tikz

在此处输入图片描述

背景

        \draw [help lines] (-5,-5) grid (5,5);

原点位于(-5,-5) 5*5 网格

对于轴

\draw [<->,line width=2pt, red] %arrow on both sides    
                        (0,-4). %start point for the axis
                            node[right]{$y$} %label on the right side
                                node[left]{$y1$}-- %label on the left side
                        (0,4) %end point for the axis
                            node[left]{$x1$} %label on the left side
                                node[right]{$x1$};%label on the right side

对于蜱虫

\foreach \i in {-3,-2,...,3} \draw [line width=2pt, blue](\i,-.1)--(\i,.1);%ticks starting from -3 to 3 horizontal axis
\foreach \z in {-3,-2,...,3} \draw [line width=2pt, blue](-.1, \z)--(.1, \z);%ticks starting from -3 to 3 vertical axis

对于相交于(-2,3)

\draw [thick, line width=2pt, dashed] (-2,0) |-   (0,3) ;

对于交叉口处的圆

\draw [thick, line width=2pt, dashed] (-2,0) |-   
                node[
                circle,
                fill=black,
                inner sep=0pt, minimum size=6pt,
                ] {}  
              (0,3) ;

对于相交处的倾斜标签

\draw [thick, line width=2pt, dashed] (-2,0) |-   
                node[
                circle,
                fill=black,
                inner sep=0pt, minimum size=6pt,
                label={
                    [label distance=0.2cm,
                        rotate=45]
                        above:(-2,3)}] {}  
              (0,3) ;

完成 MWE

\documentclass[tikz]{standalone}


\begin{document}

        \begin{tikzpicture}[scale=1,]
            \draw [help lines] (-5,-5) grid (5,5);

            \draw [<->,line width=2pt, red]         
                            (0,-4)
                                node[right]{$y$} 
                                    node[left]{$y1$}--
                            (0,4) 
                                node[left]{$x1$} 
                                    node[right]{$x1$};
            \draw [<->, line width=2pt, red]    
                            (-4,0)
                                node[above]{$y$} 
                                    node[below]{$y1$}--
                            (4,0) 
                                node[above]{$x$}
                                    node[below]{$x1$};
          \foreach \i in {-3,-2,...,3} \draw [line width=2pt, blue](\i,-.1)--(\i,.1);
                  \foreach \z in {-3,-2,...,3} \draw [line width=2pt, blue](-.1, \z)--(.1, \z);
                  
                  \draw [thick, line width=2pt, dashed] (-2,0) |-   
                    node[
                    circle,
                    fill=black,
                    inner sep=0pt, minimum size=6pt,
                    label={
                        [label distance=0.2cm,
                            rotate=45]
                            above:(-2,3)}] {}  
                  (0,3) ;

        \end{tikzpicture}

    
\end{document}

相关内容