# What's the relation between packages PGFplots and TikZ?

I've constated that I can use `tikzpicture` even if I comment `\usepackage{tikz}` out, as long as I keep `\usepackage{pgfplots}`. Isn't `tikzpicture` provided by package `tikz`? In which situation should I load both `pgfplots` and `tikz`?

-
Package `pgfplots` is based on `tikz` package. When you load it, it also load `tikz`. Actually it (simplified said) different axis environments to `tikzpicture` and simple and rich possibilities to draw graphs. – Zarko Jan 4 at 14:10
I'm guessing pgfplots is specialty use of tikz+pgf, thus it loads tikz. There is nothing wrong in loading both as latex make sure you do not accidentally loading, say, tikz twice – daleif Jan 4 at 14:12

You can in a nutshell imagine that when you write `\usepackage{pgfplots}` some code in the `pgfplots` uses the equivalent of `\usepackage{tikz}` for you. TikZ also has other packages that it depends on (`graphicx,xcolor,atbegshi` and more) and it requires for you too. So you don't need to add those again.
If you load even only `pgfplotstable` it loads `pgfplots`, TikZ and hence `xcolor`, `graphicx` and so on many packages. LaTeX has an internal consistency check whether some package is already loaded or not. Hence requesting it twice wouldn't cause any harm (as long as there are no option clashes)
I usually add `pgfplotstable` to load all the relevant gang with minimal code.
`pgfplots` is written by one of the TikZ developers, Christian Feuersanger. However `pgfplots` development is independent from TikZ with certain libraries being synced such as `fpu`.