2

Can someone please tell me how to put a grid [(-6,-6) to (6,6)] in the figure I drew using the following code. Also, if you notice the arrowheads near labels 'y1' and 'y2', those are really small so how can I increase their size.

The image attached is what I actually want. Many thanks in advance. What I want What I drew

\documentclass[11pt]{article}
\usepackage{tkz-euclide}

\begin{document}
\begin{figure}[h!]
\centering
\resizebox{7cm}{7cm}{
    \begin{tikzpicture}

    \draw[->] (-6,0)--(7,0);
    \node[scale=2, right] at (7,0) {$y_1$};
    \draw[->] (0,-6)--(0,7);
    \node [scale=2, above] at (0,7) {$y_2$};
    \draw (2,6)--(2,2)--(6,2);
    \draw (-6,2)--(-2,2)--(-2,6);
    \draw (-6,-2)--(-2,-2)--(-2,-6);
    \draw (2,-6)--(2,-2)--(6,-2);
    \node [scale=2, right] at (6,2) {$b-a$};
    \node [scale=2, right] at (6,4) {$b$};
    \node [scale=2, right] at (4,4) {$c_0$};
    \node [scale=2, left] at (-4,4) {$c_1$};
    \node [scale=2, left] at (-4,-4) {$c_2$};
    \node [scale=2, right] at (4,-4) {$c_3$};

    \draw (4,4)--(4,4);
    \filldraw (4,4) circle (3pt);
    \draw (-4,4)--(-4,4);
    \filldraw (-4,4) circle (3pt);
    \draw (4,-4)--(4,-4);
    \filldraw (4,-4) circle (3pt);
    \draw (-4,-4)--(-4,-4);
    \filldraw (-4,-4) circle (3pt);

\end{tikzpicture}
}
\end{figure}
\end{document}
3

grid can be used to draw a grid. arrows.meta offers a variety of configurable arrow tips. But there is really nothing to recommend the strange use of scale in this code so far as I can see and I would recommend looking at eliminating that rather than adding further scaling as I do here. I've also removed code which did nothing e.g. drew a line from a point to itself and compressed it a bit.

\documentclass[tikz, border=5pt, multi]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[>={Stealth[scale=2]}]
  \draw [thin, draw=gray!50!blue!50] (6,6) grid (-6,-6);
  \draw [->] (-6,0)--(7,0);
  \node[scale=2, right] at (7,0) {$y_1$};
  \draw [->] (0,-6)--(0,7);
  \node [scale=2, above] at (0,7) {$y_2$};
  \draw (2,6)--(2,2)--(6,2) (-6,2)--(-2,2)--(-2,6) (-6,-2)--(-2,-2)--(-2,-6)  (2,-6)--(2,-2)--(6,-2);
  \node [scale=2, right] at (6,2) {$b-a$};
  \node [scale=2, right] at (6,4) {$b$};
  \node [scale=2, right] at (4,4) {$c_0$};
  \node [scale=2, left] at (-4,4) {$c_1$};
  \node [scale=2, left] at (-4,-4) {$c_2$};
  \node [scale=2, right] at (4,-4) {$c_3$};
  \filldraw (4,4) circle (3pt) (-4,4) circle (3pt) (4,-4) circle (3pt) (-4,-4) circle (3pt);
\end{tikzpicture}
\end{document}

grid & scaled arrows

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.