Consider the following situation. I have three plots, where basically the axes are the same and I want to place them side by side. Since it doesn't make sense to repeat the axis labels for every plot, just the middle one has an x-axis label, while the outer ones haven't. What I would like to do now is to place the plots with respect to another, so that they are aligned properly. However, I can't put the three different datavisualizations within one tikz picture, since I have no idea how to place them properly. And if I put them in different tikzpicture environments, I can't access nodes or coordinates from the other environments. I know I could nest the three different plots within another tikzpicture, but I would like to avoid that. Is there a solution to carry out everything within a single tikzpicture environment?
EDIT
My actual goal is to not do it by trial and error, since this was the way I achieved it before. In the pgf manual is mentioned, that there is the predefined node data visualization bounding box. I hoped to being able to align the graphs by using this, but have no idea, how the datavisualization would take this as an argument. Or is there another possibility using nodes?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{datavisualization} %for graphs and pictures
\usetikzlibrary{datavisualization.formats.functions} %for graphs and pictures
%
\begin{document}
%
\begin{tikzpicture}
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={{$x^2$}}},
visualize as smooth line=one,
one={style={blue}}
]
data [set=one, format=function] {
var x : interval [-3:5];
func y = \value x ;
};
\end{tikzpicture}%
%
\begin{tikzpicture}
\datavisualization [
scientific axes,
x axis = {label={x}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=two,
two={style={green}}
]
data [set=two, format=function] {
var x : interval [-3:5];
func y = \value x * \value x/5;
};
\end{tikzpicture}%
%
\begin{tikzpicture}
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=three,
three={style={red}}
]
data [set=three, format=function] {
var x : interval [-3:5];
func y = \value x * \value x * \value x/25;
};
\end{tikzpicture}%
\vspace{1cm}
\begin{tikzpicture}
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={{$x^2$}}},
visualize as smooth line=one,
one={style={blue}}
]
data [set=one, format=function] {
var x : interval [-3:5];
func y = \value x ;
};
%
\datavisualization [
scientific axes,
x axis = {label={x}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=two,
two={style={green}}
]
data [set=two, format=function] {
var x : interval [-3:5];
func y = \value x * \value x/5;
};
%
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=three,
three={style={red}}
]
data [set=three, format=function] {
var x : interval [-3:5];
func y = \value x * \value x * \value x/25;
};
\end{tikzpicture}%
\end{document}
EDIT2
I have implemented the suggested solution using the [baseline,remember picture] option into my document, but now the problem arises, that this options leads to a mess up of my subfigure labels. :-/ Is there a cleaner solution?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{datavisualization} %for graphs and pictures
\usetikzlibrary{datavisualization.formats.functions} %for graphs and pictures
\usepackage{subfigure}
%
\begin{document}
%
\begin{figure}%
\subfigure[]{
\begin{tikzpicture}[baseline,remember picture]
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={{$x^2$}}},
visualize as smooth line=one,
one={style={blue}}
]
data [set=one, format=function] {
var x : interval [-3:5];
func y = \value x ;
};
\end{tikzpicture}%
}
%
\subfigure[]{
\begin{tikzpicture}[baseline,remember picture]
\datavisualization [
scientific axes,
x axis = {label={x}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=two,
two={style={green}}
]
data [set=two, format=function] {
var x : interval [-3:5];
func y = \value x * \value x/5;
};
\end{tikzpicture}%
}
%
\subfigure[]{
\begin{tikzpicture}[baseline,remember picture]
\datavisualization [
scientific axes,
x axis = {label={}, length=2.5cm},
y axis = {label={}, include value=-3},
visualize as smooth line=three,
three={style={red}}
]
data [set=three, format=function] {
var x : interval [-3:5];
func y = \value x * \value x * \value x/25;
};
\end{tikzpicture}%
}
%
\end{figure}
\end{document}







datavisualizationwould take this as an argument. – JMP Mar 30 '16 at 20:10pgfplotsinstead be an option? – Torbjørn T. Mar 30 '16 at 20:31tikz-datavisualization, since the whole diagram is set up, which is a little more complex, than what is included above. However, as I said, I already achieved my goal by trial and error, but I nevertheless would be interested, if there is a cleaner solution. – JMP Mar 30 '16 at 20:36