How can we generate this type of image using tikz package?


Thank you all

  • probably, you can use some pieces from here tex.stackexchange.com/questions/274219/…
    – novice
    Jun 22 '16 at 15:17
  • 1
    what kind of data do you want to generate it from ? Jun 22 '16 at 15:26
  • As there seems to be no colour pattern, you can do that with a simple tabular environment and the \cellcolor command from colortbl. Needless to summon TikZ for that.
    – Bernard
    Jun 22 '16 at 15:26
  • @ Amit : in that codes, there is a black borders and I want to fill all the squares with the same color as in the image posted here. @ Christoph: There is not a data, just I want to find a code that gives me the image Jun 22 '16 at 15:41
  • See this question. Shouldn't be hard to adapt to your situation. Jun 22 '16 at 16:23

If the color pattern is given by a mathematical function, you might want to plot it using the pgfplots colormap.

    \addplot3[surf] {exp(-((x)^2+(y)^2))};

enter image description here

  • 1
    There's also the matrix plot style in PGFPlots, which makes the squares centered on the coordinates (in your examples, the colour values of the squares represent the average of the four corner values)
    – Jake
    Jun 22 '16 at 19:13

An example with TiKZ and a colorseries from xcolor.

\foreach \x in {0,1,...,4}{
    \foreach \y in {0,1,...,7}
        \fill[test!!+] (\x,\y) rectangle ++(1,1);

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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