Take the 2-minute tour ×
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.

Venn Diagram

How do I make the text in the following figure white and center the figure?

%% LyX 1.6.9 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tikz}

\begin{document}
\begin{center}
%
\begin{figure}
\caption{Overlap of valley regions in tumourigenic cell line vs. control}

\definecolor{darkColor}{rgb}{0.102,0,0.2} %darkPurple 
\definecolor{mediumColor}{rgb}{0.2,0,0.4} %purple 
\definecolor{lightColor}{rgb}{0.413,0.315,0.615} %lightPurple
\begin{tikzpicture}[scale=1]
\tikzstyle{LeftLabel}= [text=white]
\tikzstyle{RightLabel}= [text=white]
\tikzstyle{CenterLabel}= [text=white]
\def\firstcircle{(-1.25,0) circle (1.75)}
\def\secondcircle{(1.25,0) circle (1.75)}
 %\draw[help lines] (-4,-4) grid (8,4);
  \begin{scope}
\fill[lightColor] \firstcircle;
\fill[lightColor] \secondcircle;
\clip \firstcircle;
\fill[mediumColor] \secondcircle;
  \end{scope}
  \draw \firstcircle ;
  \draw (-1,0) node [left] (LeftLabel) {Cancer} ;
  \draw node[below of=LeftLabel, node distance=.4cm] {1710};
  \draw \secondcircle ; 
  \draw (1,0) node [right] (RightLabel) {Control};
  \draw node[below of=RightLabel, node distance=.4cm] {2180};
  \draw (0,0) node [] (overlap) {};
  \draw node[below of=overlap, node distance=.4cm] {373};
\end{tikzpicture}%

\end{figure}

\par\end{center}
\end{document}
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

Either add white to the node option or use text=white for the picture. Use \centering at the beginning of the figure. The \caption belongs below figures (but above tables).

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tikz}

\begin{document}
%
\begin{figure}
    \centering
\definecolor{darkColor}{rgb}{0.102,0,0.2} %darkPurple 
\definecolor{mediumColor}{rgb}{0.2,0,0.4} %purple 
\definecolor{lightColor}{rgb}{0.413,0.315,0.615} %lightPurple
\begin{tikzpicture}[scale=1,text=white]
\def\firstcircle{(-1.25,0) circle (1.75)}
\def\secondcircle{(1.25,0) circle (1.75)}
 %\draw[help lines] (-4,-4) grid (8,4);
  \begin{scope}
\fill[lightColor] \firstcircle;
\fill[lightColor] \secondcircle;
\clip \firstcircle;
\fill[mediumColor] \secondcircle;
  \end{scope}
  \draw \firstcircle ;
  \draw (-1,0) node [left] (LeftLabel) {Cancer} ;
  \draw node[below of=LeftLabel, node distance=.4cm] {1710};
  \draw \secondcircle ; 
  \draw (1,0) node [right] (RightLabel) {Control};
  \draw node [below of=RightLabel, node distance=.4cm] {2180};
  \draw (0,0) node [] (overlap) {};
  \draw node [below of=overlap, node distance=.4cm] {373};
\end{tikzpicture}%

\caption{Overlap of valley regions in tumourigenic cell line vs. control}
\end{figure}

\end{document}

Note that you also an use transparency (e.g. opacity option) so that the overlapping area gets automatically a different color. I would also use circle shaped nodes.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{multicol}
\usepackage{tikz}

\begin{document}
%
\begin{figure}
    \centering
\definecolor{darkColor}{rgb}{0.102,0,0.2} %darkPurple 
\definecolor{mediumColor}{rgb}{0.2,0,0.4} %purple 
\definecolor{lightColor}{rgb}{0.413,0.315,0.615} %lightPurple
\begin{tikzpicture}[scale=1,text=white,font=\sffamily]
\def\firstcircle{(-1.25,0) circle (1.75)}
\def\secondcircle{(1.25,0) circle (1.75)}
  \node [fill=lightColor,draw=black,circle,minimum size=3.5cm,align=center,opacity=.666,text=white] at (-1.25,0)
  (Cancer) {Cancer\\1710};
  \node [fill=lightColor,draw=black,circle,minimum size=3.5cm,align=center,opacity=.666,text=white] at (+1.25,0)
    (Control) {Control\\2180};
  \path (Cancer) -- (Control) node [midway] {373};
\end{tikzpicture}%
\caption{Overlap of valley regions in tumourigenic cell line vs. control}
\end{figure}

\end{document}

Result

share|improve this answer
    
Works thanks! _ –  denilw May 18 '11 at 17:35
    
More useful information added, Thanks! –  denilw May 19 '11 at 17:49
add comment

Your Answer

 
discard

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.