I am trying to scatter the small and similar data with this code:
\begin{tikzpicture}
\begin{axis}[
xlabel={\(\displaystyle (\Delta t)^4\)},
xmajorgrids,
xmin=-4.96554799726869e-06, xmax=0.000104998359428441,
ylabel={\(\displaystyle z\)},
ymajorgrids,
ymin=-120.776647344602, ymax=-120.776636703454,
]
\addplot [semithick]
table {%
0.0001 -120.776646860914
4.82253086419753e-05 -120.776641857922
2.32568039361378e-05 -120.776639434005
1.12156654784615e-05 -120.776638270216
5.40878929323954e-06 -120.776637707272
2.60840533045889e-06 -120.776637436398
1.25791152124753e-06 -120.77663730572
6.0663171356459e-07 -120.776637242653
2.92550016186627e-07 -120.776637212275
1.4108314823815e-07 -120.77663719762
6.80377836796633e-08 -120.776637190555
3.28114311726771e-08 -120.776637187143
};
\addlegendentry{RK4}
\end{axis}
\end{tikzpicture}
The expected result (plotted using matplotlib
) is:
However, the LaTeX output is:
The problem is that the y-values are very small and similar to each other.
I've tried manually scaling the y-data, but that only makes the scale larger, without showing the linear trend. Forcing the rescale using scaled y axis ticks=true
and scientific notation did not work either.