[pstricks] A little help deciphering code and a question
Scott, Randy
Scott_Randy at sccollege.edu
Fri May 2 17:40:04 CEST 2014
Good Morning from Southern California,
Thanks for your suggestion Herbert. I've been playing with this code quite a bit and have another question. (I'll get more familiar with the new psxTicks and psyTicks when I have more time.)
In the output for the following code, the blue fill appears to the left of the y-axis. I suspect this is because a Bezier curve is being generated as part of the boundary, but I haven't been able to figure out a fix. I tried liftpen=0 and 1 and 2 but that resulted in no output.
Any insight would be appreciated.
Randy Scott
Santiago Canyon College
Orange, CA
\begin{pspicture}(-1,-1)(10,8)
\psset{xunit=2 ,yunit=0.6}
\psset{algebraic,plotstyle=curve}
\definecolor{SuperLightBlue}{cmyk}{0.2,0,0,0}
\pscustom[fillstyle=solid,fillcolor=SuperLightBlue,
linestyle=none]
{
\psplot{0}{0}{2}
\psplot{0}{2}{0.25*x^2+1}
}
\psaxes[labels=none, ticks=none, linewidth=0.25pt](0,0)(4.5,8.25)
[\footnotesize $q$ \textsf{(quantity)}, 90]
[\footnotesize $p$ \textsf{(price/unit)}, 90]
\psplot[linecolor=blue]{0}{4}{0.5*(x-4)^2}
\psplot[linecolor=blue]{0}{4}{0.25*x^2+1}
\psline[linestyle=dotted](2,0)(2,2)
\psline[linestyle=dotted](0,2)(2,2)
\rput(1.3,6.25){\rnode{A}{\footnotesize \textsf{Producer Surplus}}}
\pnode(0.5,1.35){B}
\nccurve[angleA=180, angleB=135]{->}{A}{B}
\rput[r](-0.05,1){\footnotesize $p_0$}
\rput[r](-0.05,2){\footnotesize $p*$}
\rput[r](-0.05,8){\footnotesize $p_1$}
\rput[t](2,-0.1){\footnotesize $q*$}
\rput[t](4,-0.1){\footnotesize $q_1$}
\rput(3.3,3){\footnotesize \textsf{Supply}}
\rput(1.5,4.25){\footnotesize\textsf{Demand}}
\end{pspicture}
-----Original Message-----
From: PSTricks on behalf of Herbert Voss
Sent: Thu 5/1/2014 11:15 PM
To: Graphics with PSTricks
Subject: Re: [pstricks] A little help deciphering code and a question
Scott, Randy schrieb:
> I am modifying a graph that I borrowed from a colleague. I hope some of
> you might be able to help me figure out the following questions I have.
>
> 1. What is the purpose of
>
> \makebox(0,0)[cc]{\footnotesize{$p_0$}}
that maeks no sense here. Also the \put commands. Use \rput instead:
\documentclass{article}
\usepackage[pdf]{pstricks}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(10,8)
\psset{xunit=2,yunit=0.75}
\psaxes[labels=none, ticks=none](0,0)(4.75,8.25)[$q$
\textsf{(quantity)},90][$p$ \textsf{(price/unit)},90]
\psset{algebraic,plotstyle=curve}
\psplot[linecolor=blue]{0}{4}{0.5*(x-4)^2}
\psplot[linecolor=blue]{0}{4}{0.25*x^2+1}
\psline[linestyle=dotted](2,0)(2,2)
\psline[linestyle=dotted](0,2)(2,2)
\psyTick(0.75){\scriptstyle p_0}
\psyTick(1.5){\scriptstyle p*}
\psyTick(6){\scriptstyle p_1}
\psxTick(4){\scriptstyle q*}
\psxTick(7.75){\scriptstyle q_1}
\rput(3.2,3){\footnotesize\textsf{Supply}}
\rput(1.8,4.25){\footnotesize\textsf{Demand}}
\end{pspicture}
\end{document}
Herbert
_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks
archive: http://www.tug.org/pipermail/pstricks/
More information about the PSTricks
mailing list