
各バーの値の科学的表記を削除するにはどうすればよいですか?
\begin{tikzpicture}
\begin{axis}[
xbar,
bar width = .3cm,
y axis line style = { opacity = 0 },
ytick = data,
yticklabels = {TACos-MLevel, LSMDC, 20BN-S-S},
% scaled ticks = false
% tick label style = {/pgf/number format/fixed}
y dir = reverse,
axis x line = none,
width = .7\textwidth,
height = .5\textwidth,
xmin = 0,
xmax = 320000,
xlabel = {number of clips},
point meta = explicit symbolic,
visualization depends on=x\as\DataX,
nodes near coords ={\pgfmathprintnumber{\DataX} \pgfplotspointmeta},
nodes near coords align=right,
enlarge y limits={abs=2*\pgfplotbarwidth}
]
\addplot coordinates {
(185,0) []
(108503,1) []
(220847,2) []
};
\addplot coordinates {
(52593,0) []
(108503,1) []
(318572,2) []
};
\legend{videos, sentences}
\end{axis}
\end{tikzpicture}
答え1
別の数値形式を使用するだけです。この例では、以下を追加しましたfixed
: \pgfmathprintnumber[fixed]{\DataX} \pgfplotspointmeta
。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xbar,
bar width = .3cm,
y axis line style = { opacity = 0 },
ytick = data,
yticklabels = {TACos-MLevel, LSMDC, 20BN-S-S},
% scaled ticks = false
% tick label style = {/pgf/number format/fixed}
y dir = reverse,
axis x line = none,
width = .7\textwidth,
height = .5\textwidth,
xmin = 0,
xmax = 320000,
xlabel = {number of clips},
point meta = explicit symbolic,
visualization depends on=x\as\DataX,
nodes near coords ={\pgfmathprintnumber[fixed]{\DataX} \pgfplotspointmeta},
nodes near coords align=right,
enlarge y limits={abs=2*\pgfplotbarwidth}
]
\addplot coordinates {
(185,0) []
(108503,1) []
(220847,2) []
};
\addplot coordinates {
(52593,0) []
(108503,1) []
(318572,2) []
};
\legend{videos, sentences}
\end{axis}
\end{tikzpicture}
\end{document}