Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Hy Guys, I'm experiencing two problems with ticklabel formats. First, if I explicitly set scaled y ticks = true, the base ten notation still appears at every tick.

Here's the diagram:

Problem Child

Here the used code for the picture:

\begin{tikzpicture}

\begin{axis}[%
scaled y ticks = true,
width=4.52083in,
height=3.56562in,
xmin=0, xmax=0.01,
ymin=-0.0025, ymax=0,
xlabel={Time t [s]},
ylabel={TopNode Displacement [m]},
xmajorgrids,
ymajorgrids,
zmajorgrids,
legend entries={$D=0$},
legend style={nodes=right},
scaled x ticks = true,
x tick label style={
rotate=90,anchor=east,},
y tick label style={/pgf/number format/.cd,sci,precision=5}]
\addplot [
color=green,
solid,
line width=1.0pt
]
coordinates{
(0,0)(9.9173e-005,-3.01301e-005)(0.000199171,-0.000141203)(0.000299992,-0.000335604)
 ....
(0.0997007,-0.0021914)(0.0998004,-0.00218975)(0.099901,-0.00218216)(0.    
100001,-0.00216898) 
};

\end{axis}
\end{tikzpicture}

I dismissed the majority of the coordinate information, otherwise this post would be some 100 lines long.

If this should ever be solved my second question is if there is a way to set the exponent of the axis multiplier to a specific value, e.g. from 10^-3 to 10^-2?

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

I think

scaled ticks=base 10:3

or similar will solve both problems. You can do scaled x ticks or scaled y ticks separately, and the number after the colon is the common exponent that you're factoring out.

(Note that this is incompatible with your current y tick label style, so you will need to remove that before this works.)

share|improve this answer
add comment

YES! scaled ticks=base 10:3 did the thang! But I had to remove the line y tick label style={/pgf/number format/.cd,sci,precision=5}.

The working code looks like this:

\begin{tikzpicture}

\begin{axis}[
scaled ticks=base 10:3,
width=4.52083in,
height=3.56562in,
xmin=0, xmax=0.01,
ymin=-0.0025, ymax=0,
xlabel={Time t [s]},
ylabel={TopNode Displacement [m]},
xmajorgrids,
ymajorgrids,
zmajorgrids,
legend entries={$D=0$},
legend style={nodes=right},]
\addplot [
color=green,
solid,
line width=1.0pt
]
coordinates{
...
};

\end{axis}
\end{tikzpicture}

Thank you so much.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.