I have a plot, code here. Now the problem I have is that because of the scale of y-axis it looks as if the plots are actually just 3 lines. Now what I want is that the y-axis is sort of splitted. Into a section ranging from -0.2 to 0.2 and a part ranging from -1.5 to -1.3…
So the y-axis would look like something
0.2 -|
|
|
-0.2 -|
|
-1.3 -|
|
|
-1.5 -|
----------------------------
Is this possible?
— Okay I see there is a workaround for this using groupplots. But the plot that I give, I was already going to use this inside a groupplot environment with 2 other plots. So can I also use the suggested method in combinations with other normal plots which are combined in a groupplot.
My current setup, now I need the splitting for the third groupplot
\begin{tikzpicture}
\pgfplotsset{%
width=4cm,
height=4cm,
scale only axis,
every x tick label/.append style={font=\scriptsize\color{gray!80!black}},
xmajorgrids,
xminorgrids,
every y tick label/.append style={font=\scriptsize\color{gray!80!black}},
ymajorgrids,
yminorgrids
}
\begin{groupplot}[%
group style={
group size=3 by 1,
horizontal sep=50pt,
vertical sep=40pt
}
]
\nextgroupplot[
xmin=0,
xmax=800,
xlabel={Time [\si{\second}]},
ymin=-0.000196069528802578,
ymax=0.000140838393117182,
ylabel={State error $\mathbf{x} - \mathbf{x}'$},
]
\addplot [
color=red,
solid,
forget plot
]
table[row sep=crcr]{
};
\addplot [
color=green,
solid,
forget plot
]
table[row sep=crcr]{
};
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
};
\nextgroupplot[
xmin=0,
xmax=800,
xlabel={Time [\si{\second}]},
ymin=-3.50920459213846,
ymax=2.98111910953132,
ylabel={$||\delta(t)||/{\delta_0}$}
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
};
\nextgroupplot[
xmin=0.5,
xmax=800,
xlabel={Time [\si{\second}]},
ymin=-1.35665432608546,
ymax=0.168623669468375,
ylabel={Lyapunov exponents},
]
\addplot [
color=blue,
solid,
forget plot
]
};
\addplot [
color=green!50!black,
solid,
forget plot
]
table[row sep=crcr]{
};
\addplot [
color=red,
solid,
forget plot
]
table[row sep=crcr]{
};
\end{groupplot}
\end{tikzpicture}%
Let me also note that I need a common y-label, so this solutions to it should be able to work… Create x and y label which overlaps for multiple plots
Best Answer
Here is a suggestion. I use a second
groupplot
environment for the third axis, and place it relative to the second axis. For theylabel
I simply usedshift
to move it down a bit. For the third axis, note that theheight
is set explicitly for each of thegroupplots
, so that their combined height is the same as the other axes (4cm).