I would like to create a bar chart graphics for which Im using matlab2tikz to generate my output. That has been working fine untill now. Now I want to create a bar chart with relatively small Y-range (ymin=0.996, ymax=1.002), and I get "Dimension too large" error. I checked the pgfplot manual and it states that actually plots with small absolute range can cause this error. So I tried to simply multiply my data by 1000 and later change the Y-Tickz, but I get the same error, even now ymin=996, ymax=1002.
Can someone help me? Thank you

Here is the original tikz code:
Code: Select all
% This file was created by matlab2tikz v0.4.1.
% Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
%
% The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
% where you can also make suggestions and rate matlab2tikz.
%
%
%
% defining custom colors
\definecolor{mycolor1}{rgb}{0,0,0.00520833333333333}%
\begin{tikzpicture}
\begin{axis}[%
width=\figurewidth,
height=\figureheight,
area legend,
scale only axis,
xmin=0.5,
xmax=4.5,
xtick={1,2,3,4},
xticklabels={A,B,C,D},
ymin=0.996,
ymax=1.002,
ylabel={Verbesserung},
ymajorgrids,
legend style={at={(0.5,1.03)},anchor=south,legend columns=2,draw=black,fill=white,legend cell align=left}
]
\addplot[ybar,bar width=0.0571428571428571\figurewidth,bar shift=-0.0357142857142857\figurewidth,fill=mycolor1,draw=black] plot coordinates{(1,1)
(2,1)
(3,1)
(4,1)};
\addlegendentry{Ohne};
\addplot [
color=black,
solid,
forget plot
]
table[row sep=crcr]{
0.5 0\\
4.5 0\\
};
\addplot[ybar,bar width=0.0571428571428571\figurewidth,bar shift=0.0357142857142857\figurewidth,fill=white,draw=black] plot coordinates{(1,1.00063267718012)
(2,1.00016121821389)
(3,1.00108135520258)
(4,0.999543145163719)};
\addlegendentry{Mit};
\end{axis}
\end{tikzpicture}%