TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

My included graphics are too blurry so I decided to find out, how to draw the following four graphics in TikZ. I never really worked with TikZ, so can someone explain how to draw such graphics?

Visualization of relations

share|improve this question
You should add a Minimal Working Example and say what is exactly your problem or what you don't know to do. – Manuel Dec 18 '12 at 1:37
You are welcome but what exactly is the question? – percusse Dec 18 '12 at 1:37
@percusse: Added the question. – Christian Ivicevic Dec 18 '12 at 1:43
up vote 10 down vote accepted

Here's one possibility:


  \node[draw,minimum width=3cm,minimum height=3cm] (#1) {};
  \draw[->] (#1.east) -- +(10pt,0) node[label=below :$\mathbb{R}$] {};
  \draw (#1.west) -- +(-10pt,0);
  \draw[->] (#1.north) -- +(0,10pt) node[label=right :$\mathbb{R}$] {};
  \draw (#1.south) -- +(0,-10pt);

\draw (a.north west)  -- node[auto,swap,midway] {$R_1$} +(1.5cm,-1.5cm) -- (a.north east);
\draw (b.north east)  -- node[auto,swap,midway] {$R_1^{-1}$} +(-1.5cm,-1.5cm) -- (b.south east);
\filldraw[draw=black,fill=blue!20] (c.north east)  -- (c.north west) -- (c.south west) -- cycle;
\node at ([xshift=15pt,yshift=-15pt]c.north west) {$R_2$};
\filldraw[draw=black,fill=blue!20] (d.north east)  -- (d.south west) -- (d.south east) -- cycle;
\node at ([xshift=-15pt,yshift=15pt]d.south east) {$R_2^{-1}$};


enter image description here

share|improve this answer

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.