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
Graphics, Figures & Tables ⇒ Plotting y=b^(x-h) with PSTricks
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
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}
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 274
- Joined: Fri Feb 05, 2010 10:15 pm
Plotting y=b^(x-h) with PSTricks
Thanks.. It worked.. I also used:
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
Code: Select all
\psplot[plotstyle=curve,linewidth=2pt,linecolor=red,arrows=<->]{2}{6}{2 x 4 sub exp}
Nick