![在 y 轴和 x 轴上画一个正方形](https://linux22.com/image/407330/%E5%9C%A8%20y%20%E8%BD%B4%E5%92%8C%20x%20%E8%BD%B4%E4%B8%8A%E7%94%BB%E4%B8%80%E4%B8%AA%E6%AD%A3%E6%96%B9%E5%BD%A2.png)
答案1
这是一个开始。
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth,dot/.style={circle,fill=blue!50,draw=blue,inner
sep=2pt},blue,thick,every label/.style={black}]
\draw[<->] (-3,0) -- (3,0);
\draw[<->] (0,-2) -- (0,2);
\draw (1,0) node[dot,label=above right:{$(1,0)$}] {}
-- (0,1) node[dot,label=above right:{$(0,1)$}] {}
-- (-1,0) node[dot,label=above left:{$(-1,0)$}] {}
-- (0,-1) node[dot,label=below left:{$(0,-1)$}] {} -- cycle;
\end{tikzpicture}
\end{document}
答案2
另一种可能性:tkz-euclide
可以添加样式以避免某些重复,例如颜色重复。
\documentclass{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmin=-3,xmax=3,ymin=-3,ymax=3]
\tkzDrawX[line width=1pt,teal,noticks,<->]
\tkzDrawY[line width=1pt,teal,noticks,<->]
\tkzDefPoints{1/0/A,0/1/B,-1/0/C,0/-1/D}
\tkzDrawPolygon[teal](A,...,D)
\tkzDrawPoints[teal,fill=teal!30,size=6](A,...,D)
\tkzLabelPoint[above right,teal](A){$(1,0)$}
\tkzLabelPoint[above right,teal](B){$(0,1)$}
\tkzLabelPoint[above left,teal](C){$(-1,0)$}
\tkzLabelPoint[below left,teal](D){$(0,-1)$}
\end{tikzpicture}
\end{document}