tikz:从科学计数法到十进制形式

tikz:从科学计数法到十进制形式

如何才能得到 (0.05,31.9) 中第一个横坐标的十进制形式值 0.05?

它被自动设置为科学家符号。

\documentclass[border=2mm]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{siunitx}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[grid style=dashed,grid=both,ymin=0,ymax=70,xmax=0.35,xmin=0,
               minor tick num=1,axis lines = middle,xlabel=$x_1$,ylabel=T\;$(\si{\celsius})$,
                x label style={at={(axis description cs:1.1,0.03)},anchor=north},
                y label style={at={(axis description cs:0,1.0)},anchor=south},               
               ]
  \addplot+[color=red,mark=*,mark options={draw=red,fill=green},smooth]
    coordinates {
    (0.05,31.9)(0.10,30.1)(0.20,35.8)(0.31,65.4)
    };
  \end{axis}
\end{tikzpicture}
\end{document}

答案1

fixed relative您可以使用以下选项来完成

\documentclass[border=2mm]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{siunitx}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[grid style=dashed,grid=both,ymin=0,ymax=70,xmax=0.35,xmin=0,
               minor tick num=1,axis lines = middle,xlabel=$x_1$,ylabel=T\;$(\si{\celsius})$,
                x label style={at={(axis description cs:1.1,0.03)},anchor=north},
                y label style={at={(axis description cs:0,1.0)},anchor=south},     x tick label style={
                    /pgf/number format/.cd,
                    fixed relative,
                },          
               ]
  \addplot+[color=red,mark=*,mark options={draw=red,fill=green},smooth]
    coordinates {
    (0.05,31.9)(0.10,30.1)(0.20,35.8)(0.31,65.4)
    };
  \end{axis}
\end{tikzpicture}
\end{document}

要得到:

在此处输入图片描述

相关内容