For coloring an area under a graph, there exist multiple approaches with pstricks.

I found a solution that was never mentioned on stack-exchange, but seems to be really simple:

\psplot[linewidth=1pt,linecolor=blue]{0.01}{5}{x log}
  \psline(3,0)(!3 dup log)
  \psplot{3}{4}{x log}
  \psline(!4 dup log)(4,0)}

However, I do not know how to adapt this example to e.g. x^2 because I do not understand what dup does. Can anybody explain it?


1 Answer 1


You can use the algebraic notation instead:


    \psline(3,0)(*3 {log(3)})
    \psline(*4 {log(4)})(4,0)}


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.