Graphics, Figures & TablesPlotting y=b^(x-h) with PSTricks

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

Plotting y=b^(x-h) with PSTricks

Post by coachbennett1981 »

I am trying to graph using PSTricks and I can not seem to find the correct coding for the following problem: plot $y=2^{x-4}$. Here are some things that I have tried...

2 x 4 sub exp
2 x 4 exp sub
2 x exp 4 sub

can anyone help?

Nick

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Plotting y=b^(x-h) with PSTricks

Post by localghost »

Code: Select all

2 x 4 sub exp = 2^(x-4)
2 x 4 exp sub = 2-x^4
2 x exp 4 sub = 2^x-4

Code: Select all

\documentclass{minimal}
\usepackage{pstricks-add}

\begin{document}
  \begin{psgraph}(0,0)(4,1){6cm}{!}   % x-y-axis with same unit
    \psplot[algebraic=true,linecolor=red]{0}{4}{2^(x-4)}
  \end{psgraph}
\end{document}
View topic: Postfix expression and PSTricks


Best regards
Thorsten
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Plotting y=b^(x-h) with PSTricks

Post by coachbennett1981 »

Thanks.. It worked.. I also used:

Code: Select all

\psplot[plotstyle=curve,linewidth=2pt,linecolor=red,arrows=<->]{2}{6}{2 x 4 sub exp}
I looked at the equation you gave and then realized I did not change my domain because your graph, 2^(x-4) looked like mine.. So thank you again for your help!


Nick
Post Reply