0

How can I draw something like the one shown in the attachment in LaTeX?

graph

I have heard about pstricks, but I am not familiar with it. If there is any good tutorial about it I will appreciate if you share it with me.

6

I choosed a simple function. Run with xelatex or the sequence latex->dvips->s2pdfor use packageauto-pst-pdfand run withpdflatex --shell-escape`:

\documentclass{article}
\usepackage{pst-plot}
\begin{document}

\psset{xunit=1.3}
\begin{pspicture}(-1,-1)(7,4)
\psaxes[labels=none,ticks=none]{->}(7,4)[$x$,-90][$\mu(x)$,180]
\psplot[algebraic]{0}{6.5}{(2*x-1)/(x+4)+1}
\multido{\iA=0+1}{7}{%
  \psline[arrows=-*,linestyle=dashed](\iA,0)(* {\iA} {(2*x-1)/(x+4)+1})}
\multido{\iA=1+1,\iB=5+-1}{5}{\psxTick(\iA){x-\iB h}}
\psxTick(0){0}\psxTick(6){x}
\end{pspicture}

\end{document} 

enter image description here

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.