In this answer we have the following code
\documentclass{article}
\usepackage{pstricks-add}
\begin{document}
\psset{plotpoints=200,algebraic}
\begin{pspicture}(-0.5,-2.5)(10,3)
\psStep[linecolor=magenta,StepType=upper,
fillstyle=solid,fillcolor=cyan!50](0,9){20}{sqrt(x)*sin(x)}
\psStep[linecolor=blue,fillstyle=solid,fillcolor=blue!30,
opacity=0.4](0,9){20}{sqrt(x)*sin(x)}
\psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3)
\psplot[linewidth=1.5pt]{0}{10}{sqrt(x)*sin(x)}
\end{pspicture}
\end{document}
It produces the following figure
the first one. It uses , however, PSTRICKS that has to be run with XeLaTeX or with some additional configuration in PDFLATEX. Since I don't want to include pstricks code in my document could someone help me convert the code to pgfplot?
I am not confortable in using pgfplot myself! THank you.


pgfplotsanswers in the linked question. Can't you use those? – Peter Grill Apr 19 '18 at 17:50pstricksinsidestandalonedocument compiled withxelatexis not a bad thing, no ? – Kpym Apr 19 '18 at 17:56That is why I want all figures to be in code format using only tikz, pgfplots...
– Tolaso Apr 19 '18 at 17:58xelatexproduce often smaller file. – Kpym Apr 19 '18 at 18:01XeLaTeX... I don't know how to use it. Sorry.! – Tolaso Apr 19 '18 at 18:02