[Tex/LaTex] Creating vertical semi-transparent stripes over TikZ drawing

tikz-pgf

While writing my thesis, I am trying to show partial orderings with various areas of it grayed out. Ideally, for clarity of explanation, I would like to gray out some of the areas using vertical stripes, as:

https://www.dropbox.com/s/pc9qx61ti2sfqk9/partialorder.png

I know how to construct the graph/poset image, but not the striped areas. Can someone point me in the right direction?

Edit. Thanks to the suggestions, I was able to make the following:

    \documentclass[tikz]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{patterns, arrows}
    \pgfdeclarepatternformonly{super ultra thick north east lines}{\pgfqpoint{-2pt}{-2pt}}{\pgfqpoint{10pt}{10pt}}{\pgfqpoint{10pt}{10pt}}%
    {
      \pgfsetlinewidth{2pt}
      \pgfpathmoveto{\pgfqpoint{-1pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{9pt}{9pt}}
      \pgfusepath{stroke}
    }
    \begin{document}
    \tikzset{
      pon/.style = {circle,align=center, black, draw=black, text width=3.0em, thick},
    }
    \begin{tikzpicture}[->,level/.style={sibling distance = 2.5cm/#1, level distance = 1.5cm}, style={very thick}] 
            \node (max)  [pon] at (0,4) {$c_1, c_2, c_3\ $};
            \node (c1c2) [pon] at (-2, 2) {$c_1, c_2$};
            \node (c1c3) [pon] at (0, 2) {$c_1, c_3$};
            \node (c2c3) [pon] at (2, 2) {$c_2, c_3$};
            \node (c1) [pon] at (-2, 0) {$c_1$};
            \node (c2) [pon] at (0, 0) {$c_2$};
            \node (c3) [pon] at (2, 0) {$c_3$};
            \draw (max) -- (c1c2);
            \draw (max) -- (c1c3);
            \draw (max) -- (c2c3);
            \draw (c1c2) -- (c1);
            \draw (c1c2) -- (c2);
            \draw (c1c3) -- (c1);
            \draw (c1c3) -- (c3);
            \draw (c2c3) -- (c2);
            \draw (c2c3) -- (c3);
      % top row shading
      \path (-2.75,4.75) rectangle (3,3) [path picture={
        \foreach \xShift in {-50,-40,...,160}
          \draw[line width=2pt, opacity=.5, shorten <=-2\pgflinewidth] ([xshift=\xShift pt] path picture bounding box.south west)
                                      -- ++ (100pt,100pt);
      }];
     % bottom
      \path (-2.75,-1) rectangle (3,1) [path picture={
        \foreach \xShift in {-50,-40,...,160}
          \draw[line width=2pt, opacity=.5, shorten <=-2\pgflinewidth] ([xshift=\xShift pt] path picture bounding box.south west)
                                      -- ++ (100pt,100pt);
      }];
    \end{tikzpicture}
    \end{document}

Best Answer

The first example uses the already defined pattern north east lines which uses the default line width of .4pt (thin) and has a fixed spacing between the lines.

The second example uses a similar defined super ultra thick north east lines with the line width2pt which also uses more spacing between the lines. Combined with the opacity this may give unedifying results as these lines are constructed out of many short lines. Depending on the viewer I have seen varying rendering.

The third example uses a path picture that works similar like a filling as it is clipped against the path itself. You also have more control over the lines as they can be positioned relative to the path. Depending on your path you might need to adjust the values if you have a higher or wider path.

Code

\documentclass[tikz]{standalone}
\usetikzlibrary{patterns}
\pgfdeclarepatternformonly{super ultra thick north east lines}{\pgfqpoint{-2pt}{-2pt}}{\pgfqpoint{10pt}{10pt}}{\pgfqpoint{10pt}{10pt}}%
{
  \pgfsetlinewidth{2pt}
  \pgfpathmoveto{\pgfqpoint{-1pt}{-1pt}}
  \pgfpathlineto{\pgfqpoint{9pt}{9pt}}
  \pgfusepath{stroke}
}
\begin{document}
\tikz\pattern[opacity=.5, pattern=north east lines] (0,0) rectangle (3,2);
\tikz\pattern[opacity=.5, pattern=super ultra thick north east lines] (0,0) rectangle (3,2);
\tikz
  \path (0,0) rectangle (3,2) [path picture={
    \foreach \xShift in {-50,-40,...,100}
      \draw[line width=2pt, opacity=.5, shorten <=-2\pgflinewidth] ([xshift=\xShift pt] path picture bounding box.south west)
                                  -- ++ (100pt,100pt);
  }];
\end{document}