I am trying to reproduce the following figure using LaTeX

enter image description here

I have previously used PSTricks to make bar plots, but that was using only a single column - not multiple as in the figure. Does PStricks support multiple columns or is a solution with tikZ better for this case?

Here is the sample-data that the example-figure was produced with:

  0         1          2
0.0046    0.0041    0.0034
0.0228    0.0168    0.0115
0.0178    0.0119    0.0119

Like this, with pst-plot and pst-bar?

 \documentclass[border=3pt, svgnames]{standalone}
\usepackage{pst-plot, pst-bar} %

\newpsbarstyle{slategray}{fillcolor=SlateGrey!80, fillstyle = solid}


\begin{postscript}%\psset{origin ={1,0}}
\psset{xAxisLabel=\sffamily k, yAxisLabel=\sffamily Axis 1,llx=-.5cm,lly=-1cm,ury=0.5cm,
\pslegend[rt](6,68){\black\rule[-0.5ex]{2em}{2ex} &\itshape first\\
\color{SlateGrey!80}\rule[-0.5ex]{2em}{2ex} & \itshape second\\%
\fbox{\white\rule[-0.5ex]{2em}{2ex}} & \itshape third}
 \begin{psgraph}[axesstyle=frame, labels = all, ticksize=4pt 0pt, Ox =-1,Dy=0.01](-0.5,0)(-0.5, 0)(4.5,0.03){8cm}{6cm}%
\psaxes[ticks=x, labels=none, ticksize=-4pt 0pt ,dx=2cm, yunit=10cm](4.5,0.03)(-0.5,0.03)
\psaxes[ticks=y, labels=y, ticksize=-4pt 0pt ,dy=2cm, Dy=0.2, ylabelPos=right, yunit=10cm](4.5,0)(4.5,0.6)
\uput{0.8}[r]{90}(4.5,0.015){\sffamily Axis 2}
 \psset{barsep=0.08, barcolsep=0.25 ,barstyle={black, slategray, white}, yunit=200cm,}%


enter image description here

| improve this answer | |

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.