tikzpicture 축 xbar 그래프에서 과학 표기법 제거

tikzpicture 축 xbar 그래프에서 과학 표기법 제거

각 막대 값의 과학적 표기법을 어떻게 제거할 수 있나요?

\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}

여기에 이미지 설명을 입력하세요

관련 정보