我的地块中出现了奇怪的神器·10^6。它是从哪里来的,我该如何摆脱它?

我的地块中出现了奇怪的神器·10^6。它是从哪里来的,我该如何摆脱它?

考虑以下代码:

\documentclass[11pt,twoside,openright]{memoir}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{xcolor}

\definecolor{color1}{RGB}{146,200,180}
\definecolor{color2}{RGB}{124,206,89}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
    xbar, xmin=0,
    y axis line style = { opacity = 0 },
    tickwidth         = 0pt,
    width=12cm, height=3.5cm, enlarge y limits=0.5,
    symbolic y coords={a,b},
    ytick=data,
    bar shift=0pt,
    y dir=reverse,
    xtick={1, 500000, 1000000},
    xticklabels={0, 5 min, 10 min},
]


\addplot+[color1, forget plot]    coordinates { (600000,a) };

\addplot+[color2, forget plot]    coordinates { (1020000,b) };
\addplot+[white, forget plot] coordinates { (600000,b) };
\addplot [white, forget plot] coordinates { (600000,b) };

\end{axis}
\end{tikzpicture}
\end{document}

得到以下图表: 在此处输入图片描述

请注意: 在此处输入图片描述

它是从哪里来的?我该如何摆脱它?

在此处输入图片描述

答案1

您可以使用scaled x ticks=false来摆脱\cdot 10^{6}

\documentclass[11pt,twoside,openright]{memoir}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{xcolor}

\definecolor{color1}{RGB}{146,200,180}
\definecolor{color2}{RGB}{124,206,89}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
    xbar, xmin=0,
    y axis line style = { opacity = 0 },
    tickwidth         = 0pt,
    width=12cm, height=3.5cm, enlarge y limits=0.5,
    symbolic y coords={a,b},
    ytick=data,
    bar shift=0pt,
    y dir=reverse,
    xtick={1, 500000, 1000000},
    xticklabels={0, 5 min, 10 min},
    scaled x ticks=false
]


\addplot+[color1, forget plot]    coordinates { (600000,a) };

\addplot+[color2, forget plot]    coordinates { (1020000,b) };
\addplot+[white, forget plot] coordinates { (600000,b) };
\addplot [white, forget plot] coordinates { (600000,b) };

\end{axis}
\end{tikzpicture}
\end{document}

相关内容