Code: Select all
Code, edit and compile here:
\documentclass[10pt,oneside]{scrartcl}\usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}\usepackage{amsmath}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{mathtools}\usepackage{pgfplots}\pgfplotsset{width=7cm,every tick/.style={black}}\usepackage{graphicx}\begin{document}\begin{center}\begin{tikzpicture}\begin{axis}[scale only axis=true,width=10cm,height=2cm,grid=none,minor tick num=1,%xtick align=center,xlabel=$x$,ytick=\empty,title={},xmin=1.48,xmax=1.54,ymin=-1,ymax=3,axis x line = bottom,axis y line = none,legend style={at={(1, 0.45)},anchor=west,font=\footnotesize,draw=black},]\addplot+[color=black,mark options={mark=*,mark size=2pt,fill=gray,scale=1},error bars,x dir=both,x explicit]coordinates {(1.51, 1.25) +- (0.02, 0)};\addlegendentry{$a$};\addplot+[color=black,mark options={mark=square*,mark size=2pt,fill=gray,scale=1},error bars,x dir=both,x explicit]coordinates {(1.504, 0.25) +- (0.003, 0)