-2

enter image description here

Hi I want to make a square arrangement just like this, this is for a data sample so I want to be able to fill some of the squares in; eg, three blank in a row followed by two black (filled) (*I am still new to this software, sorry.)

  • 7
    Try to read the first few pages (the ones with the examples at the beginning) of the TikZ manual and you will be able to draw this on your own. If you are stuck at a specific point then please update your question to be specific (with MWE). – TeXnician Jan 9 at 10:57
  • @Johannes_B My bad, I was in a rush. – Roland Gobler Jan 9 at 11:01
  • @TeXnician I have done that multiple times and am doing so as I speak. I do vaguely understand it but I am not able to make my own diagrams, that is also why I mentioned that I am a beginner, but thanks for the advice. – Roland Gobler Jan 9 at 11:06
  • 1
    I expect a clearer picture. You can use a drawing tool on the computer to make the picture quickly. – user156344 Jan 9 at 11:07
  • @JouleV sorry I was on my phone. – Roland Gobler Jan 9 at 11:13
3

The basics of tikz are not hard to understand. A basic approach could look like this and I am sure you could create this by yourself :-)

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}

  \draw[help lines] (0,1) grid (7,-3); %to guide your eye
  \draw (0,0) rectangle (1,1); %just the rectangle
  \fill[gray] (2,0) rectangle (3,1); %filled without the borders
  \filldraw[black] (4,0) rectangle (5,1); %filled with borders

  \draw (5.5,0.5) rectangle (6.5,1.5);
  \draw (5.5,-1) rectangle (6.5,0);
  \draw (5.5,-2.5) rectangle (6.5,-1.5);

\end{tikzpicture}
\end{document}

basictikz

Have you checked out http://www.texample.net/tikz/examples/ yet?

  • Thank you, I will try my best to look over the basics of Tikz again. I was just wondering, since I am trying to make a data sample with multiple diagrams like such, would It still work since you have \documentclass{standalone} and \end{document}. I am sure it is possible to do so, currently I neither have the time or the ability to be able to make a diagram like this from scratch.. I would greatly appreaciate any help. – Roland Gobler Jan 9 at 20:21
  • To be honest I don't understand what you want to get. Have a look at the link that I posted and try google search to find something, that fits your interest. – Felix Phl Jan 10 at 8:16
  • I have tried that already, that is why I am here – Roland Gobler Jan 10 at 8:59
1

A PSTricks solution just for fun purposes.

\documentclass[pstricks,border=12pt,12pt]{standalone}
\begin{document}
\pspicture(15,10)
    \rput(5,8){1. Any text goes here\ldots}
    \rput(13,9){Squares}
    \multips(0,5)(2,0){5}{\psframe(1,1)}
    \multips(10,9)(0,-2){5}{\psframe[fillstyle=solid,fillcolor=lightgray](1,1)}
\endpspicture
\end{document}

enter image description here

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