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:
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}
patterns
and the library with the same name. Though you might need to create your own thicknorth east lines
pattern (or draw it manually, e.g. with apath picture
and a\foreach
loop, which is not that fast but a little easier to do).