3

How can I get rid of the ".10^5" and plot the whole number instead?

enter image description here

\documentclass{standalone}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{pgfplots, pgfplotstable}
\usetikzlibrary{positioning}
\pgfplotsset{compat=1.16,width=0.98\textwidth}
%\pgfplotsset{compat=1.16,width=0.98\textwidth}

\usepackage{tikz}


% grid style

\pgfdeclareplotmark{mystar}{
    \node[star,star point ratio=2.25,minimum size=6pt,
    inner sep=0pt,draw=black,solid,fill=red] {};
}

\decimalpoint

\begin{document}

    \begin{tikzpicture}



    \begin{axis}[
    axis line style={black},
    legend cell align={left},
    legend style={at={(0.3,0.97)}, anchor=north west, draw=black},
    tick align=outside,
    x grid style={dashed,black!60},
    xlabel={Number of ratings},
%   xticklabel={$\pgfmathprintnumber{\tick}\%$},
    xmajorticks=true,
    xmin=100000, xmax=900000,
    xtick style={color=black},
    y grid style={dashed,black!60},
    ylabel={RMSE},
    ymajorticks=true,
    ymin=0.835985, ymax=1.027715,
    ytick style={black},
    xtick align=inside,
    ytick align=inside,
    x dir = reverse
    %   grid = both
    ]
    \addplot [mark =+,line width=1pt,blue, mark size=1.5pt,dashed]
    table {%
900000 0.9067
800000 0.9102
700000 0.9114
600000 0.9108
500000 0.9123
400000 0.9129
300000 0.9166
200000 0.9229
100000 0.9367
};
\addlegendentry{Base}
\addplot [mark =pentagon,line width=1pt,black, mark size=1pt]
table {%
900000 0.8802
800000 0.8868
700000 0.8915
600000 0.8941
500000 0.9005
400000 0.9062
300000 0.9191
200000 0.9442
100000 1.019
};
\addlegendentry{Memory}
\addplot [mark =o,line width=1pt,green!80!black, mark size=1pt]
table {%
900000 0.8447
800000 0.8522
700000 0.8607
600000 0.869
500000 0.8801
400000 0.8933
300000 0.9125
200000 0.9333
100000 0.9599
};
\addlegendentry{Model}
\end{axis}

\end{tikzpicture}
\end{document}
1

1 Answer 1

5

Adding to your axis scale ticks = false, will cause the exponential form to move to the axis:

enter image description here

But your question suggested that you simply want the zeros? In that case adding also xticklabel={\pgfmathprintnumber[fixed, fixed zerofill, precision=0]{\tick}}, will give you the full numbers, but with a busy axis: enter image description here So, you can additionally state which ticks you want, say xtick ={900000, 500000, 100000}, so that you have fewer numbers on the axis: enter image description here

2
  • Looks good! Meaning, the second option. How do you get rid of the comma?
    – NaveganTeX
    Commented Jul 18, 2019 at 17:38
  • 1
    Change the second command to xticklabel={\pgfmathprintnumber[1000 sep={}, fixed, fixed zerofill,precision=0]{\tick}},
    – John
    Commented Jul 18, 2019 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .