I am trying to draw this picture
I tried with pgfplots
.
\documentclass[border=1.5mm,12pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis line style = very thick,
axis lines = center,
xlabel=$x$, ylabel=$y$,
xtick = {-1,0,...,4},
ytick = {-1,0,...,4},
xmin = -0.5, xmax = 5.5,
ymin =-0.5, ymax = 4.5,
]
\node at (axis cs:-0.25, -0.25) {$A$};
\node at (axis cs: 4.25, 0.25) {$B$};
\node at (axis cs: 4, 3.25) {$C$};
\node at (axis cs: 0.15, 3.25) {$D$};
\node at (axis cs: 0.2, 1.2) {$M$};
\node at (axis cs: 3, 3.25) {$K$};
\addplot[very thick,mark=*] coordinates {
(4 ,0) (4,3) (0,3) (0,0) (0,1)
};
\addplot[mark=*,very thick] coordinates {
(0,0) (3,3)};
\addplot[very thick,mark=*] coordinates {
(4,0) (0,1)};
\end{axis}
\end{tikzpicture}
\end{document}
How to draw it with TikZ
?
Best Answer
If you place first all the coordinates, the rest is pretty straightforward.
Something like this: