[pstricks] Moving Image Origin on Page

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Jan 15 22:17:18 CET 2013


Am 15.01.2013 20:28, schrieb Vinay Kanetkar:

> I have a problem in changing axis labels.
> In my first graph, I would like months of year to be labels.
> In my second graph, I would like numbers to be labels.
>
> My first graph works as expected, second one does not.
> There might be command to reset options. Any help would be
> appreciated.

you can use the xLabels option:

\listfiles
\documentclass[style=fyma,
display=slides,paper=letterpaper
]{powerdot}

\usepackage{pst-plot}
\usepackage{pstricks-add}

\makeatletter
\let\oldpd at section\pd at section
\def\pd at section[#1]#2#3{\def\othersectiontext{#3}\oldpd at section[#1]{#2}}
\makeatother
\pddefinetemplate[sectionslide]{sectionothertext}{}{%
   \rput[c](.575\slidewidth,.5\slideheight){\othersectiontext}%
}
\setkeys[pd]{section}{sectemp=sectionothertext}
\def\parno{\par\noindent}
\title{Costs and Prices}
\author{Vinay Kanetkar \\
\date{January, 2013} }
\begin{document}
\maketitle

\begin{wideslide}[toc=,bm=]{Toronto Gasoline Market Margins, 2012}
\psset{yunit=0.5mm,xunit=10mm}
%
\begin{pspicture}(-0.5,-1)(12,140)%\showgrid
   \psaxes[showorigin=true,Dy=20,Ox=1,
   xLabels={January,February,March,April,May,June,July,
             August,September,October,November,December},
   xLabelsRot=30]{->}(12,140)
\pspolygon[fillstyle=solid,fillcolor=red]
(0, 122.6)(1, 128.2)(2, 131.0)(3, 134.8)
(4, 128.5)(5, 123.2)(6, 124.7)(7, 129.5)
(8, 130.0)(9, 125.0)(10, 122.5)(11, 120.5)(11, 0)(0, 0)
\pspolygon[fillstyle=solid,fillcolor=cyan]
(0, 83.8)(1, 88.7)(2, 91.2)(3, 94.6)
(4, 89.0)(5, 84.3)(6, 85.7)(7, 89.9)
(8, 90.4)(9, 85.9)(10, 83.7)(11, 81.9)(11, 0)(0, 0)
\pspolygon[fillstyle=solid,fillcolor=blue]
(0, 76.5)(1, 81.4)(2, 84.2)(3, 87.9)
(4, 82.1)(5, 77.7)(6, 80.2)(7, 84.1)
(8, 84.7)(9, 80.8)(10, 78.8)(11, 75.1)(11,0)(0,0)
\pspolygon[fillstyle=solid,fillcolor=green]
(0, 60.9)(1, 59.7)(2, 53.8)(3, 52.9)(4, 54.7)
(5, 50.9)(6, 47.7)(7, 54.6)(8, 57.2)(9, 57.9)
(10, 54.0)(11, 46.3)(11, 0)(0, 0)
\rput*[lB](5,110){\tiny Taxes, \$0.393}
\rput*[lB](5,85){\tiny Retailer Margin, \$0.063}
\rput*[lB](5,68){\tiny Refiner Margin, \$0.269}
\rput*[lB](5,30){\tiny Cost of Crude, \$0.542}
\rput[lb](-.2,-25){\tiny Source: 
http://www.kentmarketingservices.com/dnn/PetroleumPriceData.aspx}
\end{pspicture}
\end{wideslide}

\begin{slide}[toc=,bm=]{Graphical Illustration of Price Increase}

\begin{center}
\psset{xunit=1cm,yunit=.5cm,linecolor=lightgray}
\begin{pspicture}(0,0)(10,15)%\showgrid
{\scriptsize \psaxes[linecolor=lightgray,Dx=1,Dy=2]{->}(0,0)(0,0)(10,15)}
\pspolygon*[linecolor=gray,linewidth=1.5pt](0,0)(0,5.5)(4,5.5)(4,0)
\pspolygon[linecolor=brown,linewidth=1.5pt](0,0)(0,10)(4,10)(4,0)
\pscurve[linewidth=2pt]{-}(9,7.5)(7.2,8)(6,8.5)(5.143,9)(4.5,9.5)(4,10)(3.6,10.5)(3.273,11)(3,11.5)(2.77,12)(2.57,12.5)(2.4,13)(2.25,13.5)
\psdots[dotstyle=o](9,7.5)(7.2,8)(6,8.5)(5.143,9)(4.5,9.5)(4,10)(3.6,10.5)(3.273,11)(3,11.5)(2.77,12)(2.57,12.5)(2.4,13)(2.25,13.5)
\rput(2,3){{\scriptsize Variable Cost}}
\rput(5,-1.75){Quantity Sold (in '000)}
\rput(-.5,7){\rotateleft{Price}}
\rput(3.3,12){{\scriptsize +10\%}}
\rput(5.2,10){{\scriptsize $-10$\%}}
\psline[linecolor=cyan,linewidth=2pt](0,10)(0,11)(3.273,11)(3.273,0)
\pspolygon[linecolor=magenta,fillstyle=solid,fillcolor=magenta](0,10)(0,11)(3.273,11)(3.273,10)(0,10)
\pspolygon[linecolor=magenta,fillstyle=solid,fillcolor=magenta](3.273,5.5)(3.273,10)(4,10)(4,5.5)(3.273,5.5)
\rput(2,10.5){{\scriptsize Revenue Gain}}
\rput(3.6,7.5){{\scriptsize Loss}}
\end{pspicture}
\end{center}
\end{slide}

\end{document}


Herbert


More information about the PSTricks mailing list