Graphics, Figures & Tablescube root functions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

cube root functions

Post by coachbennett1981 »

Good evening, below is the code I have for generating a cube root of x function, but when I plot it, the pdf file won't generate. It says

GPL Ghostscript 8.70: Unrecoverable error, exit code 1
### FAILED to generate /tmp/altpdflatex.94297-1286246774/Section 1.6 Transformations of Functions.pdf ()

What did I do wrong?

Code: Select all

\documentclass[10pt]{article}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-5,-4.46)(5,6.3)
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1,Dy=1,ticksize=-2pt 0,subticks=2]{->}(0,0)(-5,-4.46)(5,6.3)
\psplot[plotpoints=200]{-5.0}{5.0}{cbrt(x)}
\rput[bl](-4.2,-1.9){$f$}
\end{pspicture*}
\end{document}

Last edited by coachbennett1981 on Tue Oct 05, 2010 12:54 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

cube root functions

Post by CrazyHorse »

coachbennett1981 wrote:Good evening, below is the code I have for generating a cube root of x function, but when I plot it, the pdf file won't generate. It says

GPL Ghostscript 8.70: Unrecoverable error, exit code 1
### FAILED to generate /tmp/altpdflatex.94297-1286246774/Section 1.6 Transformations of Functions.pdf ()
What did I do wrong?

Code: Select all

\psplot[plotpoints=200]{-5.0}{5.0}{cbrt(x)}
only God knows what cbrt should be, but not GhostScript ...

Code: Select all

\documentclass[10pt]{article}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}

\psset{algebraic,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture}(-5,-3)(5.2,3.2)
\psaxes[labelFontSize=\scriptstyle,ticksize=-2pt 0,
  subticks=2]{->}(0,0)(-5,-3)(5,3)[$x$,0][$y$,90]
\psplot[plotpoints=200,linecolor=blue,
  linewidth=1.5pt]{-5}{5}{IfTE(x>0,x^(1/3),-abs(x)^(1/3))}
\rput[tl](-4.2,-1.9){$f$}
\end{pspicture}

\end{document}
However, it looks like that you create your code with a gui,
the reason why you always have a lot of unneeded definitions.

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: cube root functions

Post by coachbennett1981 »

cbrt=cube root. I used Geogebra to do the sketch because I could not figure out the code. That was the code expressed from the the function.. Thank you for your help.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

cube root functions

Post by CrazyHorse »

coachbennett1981 wrote:cbrt=cube root. I used Geogebra to do the sketch because I could not figure out the code. That was the code expressed from the the function..
then file a bug report to geogebra

HErbert
Post Reply