0

The ticks are sticking close to each other, almost overlapping. How to change the ticks from $2.5\cdot 10^{-2}$ to just $0.025$ without changing the dimensions of the diagram ?

enter image description here

\begin{tikzpicture}
\pgfplotsset{width={.5\textwidth},height={6 cm}}
\begin{axis}[ylabel={$\ln (I/I_0)$},
grid=major,
legend style={ legend pos= north east,},
xtick distance= .025,
]
\addplot[red, mark=square, only marks,]coordinates{
(0., 0.) (0.025, -0.842) (0.05, -1.671) (0.075, -2.217) (0.1, -2.823)};
\legend{$\theta = 11.0^\circ$; $\lambda = 0.77$ pm}
\end{axis}
\end{tikzpicture}

The after a comment enter image description here

Physor
  • 431

1 Answers1

1

Try this:

\documentclass[border=1mm]{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture} \pgfplotsset{width={.5\textwidth},height={6 cm}} \begin{axis}[ylabel={$\ln (I/I_0)$}, grid=major, legend style={legend pos=north east}, xtick distance=.025, xticklabel style={/pgf/number format/fixed, /pgf/number format/precision=3} ] \addplot[red, mark=square, only marks,]coordinates{ (0., 0.) (0.025, -0.842) (0.05, -1.671) (0.075, -2.217) (0.1, -2.823)}; \legend{$\theta = 11.0^\circ$; $\lambda = 0.77$ pm} \end{axis} \end{tikzpicture}

\end{document}

enter image description here