摆脱指数符号

摆脱指数符号

我怎样才能摆脱“.10^5”并绘制整个数字?

在此处输入图片描述

\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

添加到轴上scale ticks = false,将导致指数形式移动到轴上:

在此处输入图片描述

但你的问题暗示你只想要零?在这种情况下,添加也会 xticklabel={\pgfmathprintnumber[fixed, fixed zerofill, precision=0]{\tick}},给你完整的数字,但会有一个繁忙的轴: 在此处输入图片描述 因此,您还可以另外说明您想要哪些刻度,xtick ={900000, 500000, 100000},这样轴上的数字就会更少: 在此处输入图片描述

相关内容