0

How to delete extra labels on X axis: 53, 113, 241.

I spent plenty of time to do it reading manuals on pgfplots and others...

\usepackage{pgfplots}

...

\begin{tikzpicture}    
   \begin{axis}[title = Performance comparison of our approach vs. Synopsys for 100-bit inputs,
      width=320,
      x tick label style={/pgf/number format/1000 sep=},
      symbolic x coords={19, 53, 113, 241},
      legend style={at={(0.5,-0.2)}, anchor=south},
      legend columns=-1,
      ymax=1200,
      ybar,
      ylabel={Frequency, MHz},
      xlabel={Moduli},
      nodes near coords,
      every node near coord/.append style={font=\scriptsize}
   ]    
     \addplot coordinates {(19,1162) (53,840) (113,819) (241, 862)};   
     \addplot coordinates {(19,662) (53,746) (113,892) (241, 869)};
     \addplot coordinates {(19,564) (53,854) (113,634) (241, 789)};

     \legend{Synopsys, group, bits}
   \end{axis} 
\end{tikzpicture}

enter image description here

2

Welcome! You seem to be looking for xtick=data.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}

\begin{axis}[title = Performance comparison of our approach vs.\ Synopsys for 100-bit inputs,
    width=320,
    x tick label style={/pgf/number format/1000 sep=},
    symbolic x coords={19, 53, 113, 241},
    xtick=data,
    legend style={at={(0.5,-0.2)}, anchor=south},
    legend columns=-1,
    ymax=1200,
    ybar,
    ylabel={Frequency, MHz},
    xlabel={Moduli},
    nodes near coords,
    every node near coord/.append style={font=\scriptsize}]

\addplot coordinates {(19,1162) (53,840) (113,819) (241, 862)};

\addplot coordinates {(19,662) (53,746) (113,892) (241, 869)};

\addplot coordinates {(19,564) (53,854) (113,634) (241, 789)};

\legend{Synopsys, group, bits}

\end{axis}

\end{tikzpicture}
\end{document}

enter image description here

BTW, you will usually get much earlier an answer if you provide us with complete minimal working examples which start with \documentclass and end with \end{document}, and can be compiled.

  • thank you so much!!! You are the God of Latex)) – Fireball Oct 26 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.