[pstricks] Need help tracking bug!
Alan Ristow
ristow at ece.gatech.edu
Mon Jan 24 20:09:34 CET 2005
Hi,
I recently had a user contact me about a problem he was having with
pst-bar, my bar chart drawing package. He provided a minimal example,
which I have pasted below. I have found the line of code that is causing
the problem, but I cannot figure out *why* it is causing the problem.
The issue the user is having is related to a strange interaction between
the barlabelrot key and ps2pdf. The key is intended to rotate the text
labels at the bottom of each bar of the chart. As long as the value
specified by the user is not some integer multiple of 90, everything
works fine. Similarly, as long as the user only views the PS output,
everything is fine. However, when barlabelrot *is* an integer multiple
of 90 it causes ps2pdf to rotate the page on which the chart appears by
the same angle. Neighboring pages are unaffected.
In the pst-bar source, the bar labels are set using the following command:
\uput[-90]{\psk at barlabelrot}(\pst at tempb,-\psbarlabelsep)%
{\psbarlabel{\pst at tempa}}%
If I comment out this command, the problem with ps2pdf disappears (but
then, so do the bar labels). (FYI, \pst at tempa contains the text to be
typeset, \psbarlabel contains formatting commands similar to \pshlabel,
and \pst at tempb locates the center of the column to be labeled.)
I cannot think of another instance where I have seen the rotation
argument to \uput cause ps2pdf rotate a page. Currently, pst-bar does
not use pst-xkey, but a (rather hurried) conversion to pst-xkey seems to
indicate that this is not the problem. On the other hand, I do not
recall seeing this problem prior to pstricks being converted to pst-xkey.
I am completely stumped. Any suggestions or ideas?
Thanks,
Alan
\documentclass[a4paper,10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{pstricks}
\usepackage{pst-bar}
\begin{filecontents*}{entwicklung1.csv}
1300--1349, 1350--1399, 1400--1449, 1450--1499
1, 2, 2, 6
1, 0, 4, 1
0, 0, 1, 3
0, 0, 0, 2
1, 2, 0, 0
\end{filecontents*}
\begin{document}
\psset{unit=1cm}%
\begin{pspicture}(0,-1.5)(9,14)%
\psgrid[xunit=4cm,gridlabels=0,%
subgriddiv=0,griddots=30](0,0)(1,13)%
\psaxes[axesstyle=frame,Ox=0,Dx=1,Dy=2,labels=y,%
ticks=y](0,0)(4,13)%
\readpsbardata[header=true]{\data}{entwicklung1.csv}%
\psbarchart[barstyle={red,blue,green,black,white},%
chartstyle=stack,barlabelrot=90]{\data}%
\end{pspicture}
\end{document}
More information about the PSTricks
mailing list