![对角坐标网格 Tikz](https://linux22.com/image/458076/%E5%AF%B9%E8%A7%92%E5%9D%90%E6%A0%87%E7%BD%91%E6%A0%BC%20Tikz.png)
答案1
您可以使用scope
并通过坐标变换改变里面的轴cm
,这允许您将这种变换定义为矩阵(参见手册)。
例如,以下代码:
\documentclass[border=2mm,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\clip (-3.5,-3.5) rectangle (3.5,3.5);
% standard grid
\draw[gray] (-4,-4) grid (4,4);
% new grid
\begin{scope}[cm={2,-2, % unit vector, new x axis
1,1, % unit vector, new y axis
(0,0)}] % new origin
\draw[magenta] (-4,-4) grid (4,4);
% point B(1,1) in the new grid
\node[fill,circle,minimum size=3pt,inner sep=0,label={[right]B}] at (1,1) {};
\end{scope}
% point A(1,1) in the standard grid
\node[fill,circle,minimum size=3pt,inner sep=0,label={[right]A}] at (1,1) {};
% original axes
\draw[thick,-latex] (-3.5,0) -- (3.5,0);
\draw[thick,-latex] (0,-3.5) -- (0,3.5);
\end{tikzpicture}
\end{document}
生产