[pstricks] 2 questions about bardiag

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Sun Nov 30 17:24:06 CET 2003


Patrick Drechsler wrote:

> 1.) With your help the legend background is now transparent, but there
>   is not only (a) a black line around the legend but also (b) a black
>   line in between the 2 items of the legend:
> 
> _____________
> | xx item 1 |
> -------------  <-- (b)
> | xx item 2 |
> -------------  <-- (a)
> 
>   Is there an easy way of removing (b) and setting (a) to a color
>   of my liking (i.e. white or transparent)?
> 
> 2.) You managed to get rid off the complete frame. Originally I just
>   wanted to remove the top part and the right hand part of the
>   frame. The x- and y-axis should still be visible. 
> 
> | <-- visible y-axis
> |
> |________  <-- visible x-axis
> 

\documentclass[slideColor,colorBG,pdf,azure,noaccumulate]{prosper}
\usepackage{bardiag}
%
\def\diagLegenditem#1#2{%
  \addtolength{\legendHeight}{\legenditemheight}%
  \setlength{\liyycoor}{\liycoor}%
  \addtolength{\liycoor}{-\legenditemheight}%
  \legendPutRect{#2}%
  \setlength{\legendiyc}{(\liycoor+\liyycoor)/2}%
  \rput[l](\liiix,\legendiyc){#1}%
}
\def\diagLegendend{%
    \ifthenelse{\legendShadow = 1}
      {\setlength{\lShX}{\legendXo+\xunitlength*\dbar*\real{\tdhor}}
          \setlength{\lShXxx}{\lixxcoor+\xunitlength*\dbar*\real{\tdhor}}
          \setlength{\lShY}{\liycoor+\yunitlength*\dbar*\real{\tdver}}
          \setlength{\lShYyy}{\legendYo+\yunitlength*\dbar*\real{\tdver}}
          \psframe[fillstyle=solid,%
             linecolor=\legendShadowColor,%
		    fillcolor=\legendShadowColor](\lShX,\legendYo)(\lShXxx,\lShYyy)
          \psframe[fillstyle=solid,%
	        linecolor=\legendShadowColor,%
	        fillcolor=\legendShadowColor](\lixxcoor,\lShY)(\lShXxx,\lShYyy)%
      }{}%
}

\begin{document}
%
\begin{slide}{Slide1}%
   % following line has to be in front of \bardiagrambegin!!:
   \newpsstyle{diagframestyle}{linewidth=1pt,%
       linestyle=none,fillstyle=none}%
   \bardiagrambegin{10}{10}{2cm}{4}{5}{0.6cm}{0.6cm}%
   \psline[linecolor=white]{->}(0,0)(10,0)
   \psline[linecolor=white]{->}(0,0)(0,10)
   \renewcommand{\shownumbers}{0}%
       \setlength{\captionoffset}{8mm}%
       \baritem{ }{5}{green}%
       \baritem{ }{8}{yellow}%
       \diagLegendbegin{0.5}{9.8}{4}%
       \diagLegenditem{\white\tiny\textbf{foo}}{green}%
       \diagLegenditem{\white\tiny\textbf{bar}}{yellow}%
       \diagLegendend%
       \bardiagramend{Foo}{Bar}%
     \end{slide}%
\end{document}



Herbert




-- 
http://www.pstricks.de/




More information about the PSTricks mailing list