2

I use:

\documentclass[hyperref={unicode,bookmarks=true}, clock,fragile]{beamer}
\usepackage{amsmath,amssymb,amsfonts, mathrsfs}
\usepackage[utf8]{vietnam}
\usepackage{tikz,tkz-tab,pgf}
\usepackage{pgfplots}
\usetikzlibrary{arrows,decorations,decorations.pathmorphing,
shapes}
\usetikzlibrary{arrows,decorations,decorations.pathmorphing,
shapes,decorations.text,trees,positioning,datavisualization}
\usepackage{pgfcore}
\usepgflibrary{datavisualization.formats.functions}
\usetheme{Darmstadt}
\usetheme{CambridgeUS}
\begin{document}
\begin{frame}
\begin{tikzpicture}[baseline]
\datavisualization [ scientific axes=clean,
y axis=grid,
visualize as smooth line/.list={sin,cos,tan},
style sheet=strong colors,
style sheet=vary dashing,
sin={label in legend={text=$\sin x$}},
cos={label in legend={text=$\cos x$}},
tan={label in legend={text=$\tan x$}},
data/format=function ]
data [set=sin] {
var x : interval [-0.5*pi:4];
func y = sin(\value x r);
}
data [set=cos] {
var x : interval [-0.5*pi:4];
func y = cos(\value x r);
}
data [set=tan] {
var x : interval [-0.3*pi:.3*pi];
func y = tan(\value x r);
};
\end{tikzpicture}
\end{frame}
\end{document}

But when run pdfLatex I get"! Package pgfkeys Error: I do not know the key '/tikz/data visualization/style sheet'" How to fix it? Thanks.

percusse
  • 157,807
man
  • 81
  • This is 'works for me' with an up to date TeX Live 2014. Can you add \listfiles to your input and report the results File list in the question? (BTW, you might also minimise your example further: I suspect things like beamer and Vietnamese text are not relevant to the problem.) – Joseph Wright Oct 15 '14 at 08:55
  • 3
    Put \pgfversion in your document and make sure it is v3.00. Data visualization is a recent feature. The code works on my computer. – percusse Oct 15 '14 at 09:23
  • My version is 2.1. I just get v3.0. How to change my version from 2.1 to 3.0? I uses texmaker. Thanks. – man Oct 15 '14 at 12:37
  • Texmaker doesn't really have anything to do with that, which distribution do you have? MikTeX, TeX Live, MacTeX, ... – Torbjørn T. Oct 15 '14 at 13:03
  • I uses Tex Live. – man Oct 15 '14 at 15:01
  • 1
    You don't say which version of TeX Live, but it's not the latest version. Personally, I think I would install TeX Live 2014, which will include PGF 3.0, and the newest versions of a bunch of other packages. If you're on Ubuntu or similar, see How to install "vanilla" TeXLive on Debian or Ubuntu? for instructions. If you're on Windows, just install as usual. Alternatively, if you downloaded the .tds.zip file from SourceForge, see method 3 in How do I install an individual package on a Linux system? for intruction – Torbjørn T. Oct 17 '14 at 20:42
  • 4
    I'm voting to close this question as off-topic because it's a problem caused by outdated packages (pgf, in this case). – Paul Gessler Feb 18 '15 at 13:49

0 Answers0