TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use the grid pattern on a node but also setting a background color to it, say blue?

I want to use something like

\node (b) [fill=red, pattern=grid] {b};

I am aware of the solution here: How to combine fill and pattern in a pgfplot bar plot?, but it does not seem to apply directly to a node. Thanks in advance!

share|improve this question
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). – Claudio Fiandrino Jul 22 '12 at 16:59
up vote 18 down vote accepted
\tikz{\node[preaction={fill, red}, pattern=grid] {b};}


enter image description here

share|improve this answer
Worked like a charm! Thank you so much, especially for the timely reply! Saved my life by the due date! – Leshui Jul 22 '12 at 17:37
So... Accepted answer? :-) – JLDiaz Jul 22 '12 at 17:49
I am newbie on posting and answering questions though. Can you let me know if there's a way to formally ``accept'' the answer to help your reputation? I am happy to do it! – Leshui Jul 22 '12 at 17:57
Yes, click on the check mark which is under the vote arrows. – JLDiaz Jul 22 '12 at 18:00
Done! Thx again! :-) – Leshui Jul 22 '12 at 18:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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