# Using PGF in Lyx

I just tried coping & pasting code from How to draw Venn diagrams (especially: complements) in LaTeX

and I get errors ... I suppose I need to install/configure Lyx to use PGF/Tikz?

-
You need to add `\usepackage{tikz}` to your preamble (I think you can do this by selecting `LaTeX preamble` from the `Layout` menu). –  Jake Aug 28 '11 at 12:42
I think you should change the Editor. I think in cases like this LyX reaches his capability –  Marco Daniel Aug 28 '11 at 13:25
@Jake, I added `\usepackage{tikz}` under `Document > Settings > LaTeX preamble` I still got the same error. –  Jiew Meng Aug 28 '11 at 13:46
@Marco, what editors do you recommend? –  Jiew Meng Aug 28 '11 at 13:46
@Jake, thanks you got me on the right track! I needed `\usepackage{pgfplots}` too –  Jiew Meng Aug 28 '11 at 13:49

You need to add `\usepackage{pgfplots}` to your preamble. In LyX, you can edit the preamble under `Document | Settings | LaTeX Preamble`.