This question already has an answer here:

I get the error:

    ! Undefined control sequence.<recently read> \c@lor@to@ps }

when trying the following graph

\usepackage{pst-grad} % For gradients
\usepackage{pst-plot} % For axes


\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm     2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.8,-2.3398876)(0.8,2.4601123)
\psline[linecolor=black, linewidth=0.04, arrowsize=0.05291666666666667cm                 2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.4,-1.9398876)(5.2,-1.9398876)
\psline[linecolor=red, linewidth=0.04](1.2,-1.5398877)(4.8,2.0601122)(4.8,2.0601122)


It should be something easy, but I'm not a pro. Please, help me!

marked as duplicate by Christoph, jub0bs, user31729, Mico, Werner May 18 '14 at 21:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

% compile it with
% pdflatex -shell-escape filename

\documentclass[border=12pt,12pt]{standalone}% change it back to article or whatever you want to use

\foreach \compiler/\ext in {latex/tex,dvips/dvi,ps2pdf/ps}{\immediate\write18{\compiler\space diagram.\ext}}


enter image description here


When using PSTricks, you have to use latex or xelatex to compile the image.

If you use TikZ/PGFPlots, you can also use pdflatex:



    axis lines=middle,
    xmin=0, xmax=10,
    ymin=0, ymax=10,
    xtick=\empty, ytick=\empty,
    axis equal image,
    xlabel=$x$, ylabel=$f(x)$
\addplot [red, very thick, domain=1:10] {x};

Not the answer you're looking for? Browse other questions tagged or ask your own question.