2

I'm not really familiar with LaTeX (started working with it 2 days ago). Most of that work I'm doing in Overleaf, I only recently moved to graphs, could anyone possibly provide me a simple stair chart that I would be able to put in Overleaf and edit?

Example here: https://i.stack.imgur.com/2DucA.jpg

I found some example here: Tikzpicture: Step function (most minimalistic!)

But I'm having hard time with editing it.

Many thanks to anyone kind enough to help me!

EDIT: so far I have this code:

\usepackage{pst-all}    
\begin{document}    
\begin{pspicture}(-1,-1)(5,5)   
\psaxes{->}(0,0)(-0.5,-0.5)(4.5,4.6)[$x$,0][$y$, 180]   
\end{pspicture}
\vspace{1.6in}

and I want to make this out of it:

enter image description here

  • Hi, welcome to TeX.SX! What do you want to change from the example you mention? (And which of the three answers were you specifically looking at?) – Torbjørn T. Jan 17 '17 at 12:14
  • I was looking at the first one, but it's not quite it. So far I managed to do the axes and numbers in them using Overleaf: http://i.imgur.com/bdsfiIa.png

    Now I want to draw in it something like this: http://i.imgur.com/mEzvMUz.png

    So basically what I need right now is some hint on how to draw the mentioned line, thank you!

    – callmeadr Jan 17 '17 at 12:21
  • Well, if you're using the code from the accepted answer there, you just need to change the coordinates used in the \addplot statement. – Torbjørn T. Jan 17 '17 at 12:30
  • No, this is the code I'm using:

    \usepackage{pst-all} \begin{document} \begin{pspicture}(-1,-1)(5,5) \psaxes{->}(0,0)(-0.5,-0.5)(4.5,4.6)[$x$,0][$y$, 180] \end{pspicture} \vspace{1.6in}

    And it doesn't allow me to use \addplot in Overleaf for some reason

    – callmeadr Jan 17 '17 at 12:42
  • No, it doesn't work because \addplot, which is defined by the pgfplots package, only works inside an axis environment, which must be inside a tikzpicture environment. Why can't you use the code from one of the answers to the question you referred to, and just change the coordinates? – Torbjørn T. Jan 17 '17 at 12:45
  • Well I could, it just interests me how to insert same coordinates with lines in the chart that I managed to write – callmeadr Jan 17 '17 at 13:07
  • Then please edit your question to include the code you already have. I don't really know pstricks, so I cannot help, but if you edit the question there is a greater chance that someone who does know sees it. (In general, if you have some code that does part of what you're after, add it to the question, and describe what more you want to do.) – Torbjørn T. Jan 17 '17 at 13:12

1 Answers1

1
\documentclass{article}
\usepackage{pst-all}    
\begin{document}    
\begin{pspicture}(-1,-1)(5,5)   
\psaxes{->}(0,0)(-0.5,-0.5)(4.5,4.6)[$x$,0][$y$,180]   
\psline[linewidth=2pt](0,1)(1,1)(1,2)(2,2)(2,3)(3,3)
\end{pspicture}
\end{document}

enter image description here

there are several other possibilities.