Debian Codegraph @

texmf-dist/doc/latex/bardiag/bardiag.tex

raw
1 \documentclass[12pt]{article}
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
4 \usepackage{barddoc}
5
6 \title{The \bard package
7 \thanks{This file has version number \barvers and describes \bard ver.\barvers}
8 }
9
10
11 \makeindex
12
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 \begin{document}
15 \maketitle
16 \begin{abstract}
17 The \bard package is inspired and entirely based on \pst package.
18 The main purpose is to make the drawing of (simple)
19 bar diagrams possible and (I hope) easy in La\TeX{}.
20 \end{abstract}
21
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23
24 \mysection{Package installation \label{sec:1}}
25
26 The \bard package consists of two sty-files:
27 \pac{bardiag.sty} (written by me)
28 and \pac{pstfp.sty} which is an almost exact copy of
29 the \pac{fp-basic.sty} package
30 by Michael Mehlich. The second one is needed to work with floating
31 point numbers and has been patched to work with \pac{multido.sty} from the
32 \pst. The \pac{bardiag.sty} also loads \pac{bardiag.bar} with some
33 internal routines.
34
35 The \bard depends on \pac{pstricks}, \pac{pstcol}, \pac{pst-grad},
36 \pac{multido}, \pac{calc}, \pac{fp-snap}, \pac{ifthen},
37 so make sure they are installed. Then copy
38 the \pac{bardiag.sty}, \pac{bardiag.bar}, and \pac{pstfp.sty}
39 files into your texmf tree,
40 where La\TeX{} is able to find them. That's it!
41
42 This manual consists of three files: this one (\texttt{bardiag.ps}),
43 \texttt{bardiag1.ps}, and \texttt{bardiag2.ps}.
44 The present one describes the installation and features needed to draw
45 ``vertically'' oriented diagrams, i.e. with bars parallel to
46 the Y-axis; \texttt{bardiag1.ps} explains how to build ``horizontal''
47 bar diagrams; and \texttt{bardiag2.ps} includes all appendices,
48 including some source listings and examples of alternative shapes, not
49 included in the \bard\texttt style-file itself, but available as a config file.
50
51 In the \pac{example} directory you can find: (i) \pac{diagrams.tex} which
52 contains some examples of colored diagrams; (ii) \pac{diagramsbw.tex} with b/w
53 diagrams -- it is shown how to use pattern filling instead of color; (iii)
54 \pac{altdiags.tex} represents some ``alternative'' bar shapes.
55
56 \mysection{Quick start \label{sec:2}}
57
58 \subsection{Simple bar diagram \label{sec:2.1}}
59 Let me start from an example. One wants to draw a diagram, representing table~\ref{tab:1}.
60 \begin{table}[!h]\centering
61 \begin{tabular}{c||ccccc}
62 Year & 1998 & 1999 & 2000 & 2001 & 2002 \\\hline
63 Income & 120 & 123 & 147 & 176 & 132
64 \end{tabular}
65 \caption{\label{tab:1} See diagram \figref{fig:1}.}
66 \end{table}
67 %
68 It can be done with the following piece of code
69 \lstinputlisting{figs/examp1.tex}
70 The result is \figref{fig:1}.
71 So, a bit of explanation now.
72
73 Any diagram begins with \verb+\bardiagrambegin+
74 \index{Commands!bardiagrambegin}
75 and ends with
76 \verb+\bardiagramend+ \index{Commands!bardiagramend}
77 commands. Arguments of the first one are\\
78 \verb+\bardiagrambegin{diagheight}{diagwidth}{bottomheight}{dbar}{dx}{xunit}{yunit}+
79
80 \begin{figure}[t]\centering
81 \input{figs/examp1.tex}
82 \caption{\label{fig:1} Example 1 to table~\ref{tab:1}.}
83 \end{figure}
84
85 \begin{figure}[t]\centering
86 \includegraphics[scale=0.5]{figs/diag.eps}
87 \caption{\label{fig:2} Arguments (shown with \#1..5) of the
88 \texttt{bardiagrambegin} command and other parameters}
89 \end{figure}
90
91 The meaning of the first 5 arguments is apparent from the
92 \figref{fig:2}. The 6th and the 7th parameters are unit lengths along
93 x- and y-axis correspondingly. Note, that \texttt{diagheight},
94 \texttt{diagwidth}, \texttt{dbar}, and \texttt{dx} are NOT lengths, but
95 (floating point) numbers. They are then converted to lengths
96 automatically using \texttt{xunit} and \texttt{yunit}. However
97 \texttt{bottomheight} is a ``real'' length and should be accompanied,
98 exactly as \texttt{xunit} and \texttt{yunit}, by \texttt{cm} or
99 \texttt{in} or whatever you find more comfortable for yourself. This
100 allows to scale the diagram changing \texttt{xunit} and/or
101 \texttt{yunit} but leave the bottom part of the same height. Just to
102 demonstrate that I drew the same diagram
103 as \figref{fig:1}, but used a
104 smaller last argument in \texttt{bardiagrambegin}:\\
105 \verb+\bardiagrambegin{9.5}{200}{2cm}{1}{2}{1cm}{0.01cm}+\\
106 As you see on \figref{fig:3} the bottom remains readable.
107 \begin{figure}[!ht]\centering
108 \input{figs/examp1a.tex}
109 \caption{\label{fig:3} The same data as in \figref{fig:1} but
110 \texttt{yunit} is 0.1cm instead of 0.5cm.}
111 \end{figure}
112
113 The \verb+\bardiagrambegin+ begins a bar diagram and
114 \verb+\bardigramend+ \index{Commands!bardiagramend}
115 ends it. It has two arguments: x and y label. In
116 the example above they are \verb+{\large Year}+ and
117 \verb+{\large Income}+ correspondingly.
118
119 Between the ``begin'' and ``end'' statements
120 one actually ``draws the stuff''. Command\\
121 \verb+\baritem{caption}{value}{color}+ \index{Commands!baritem}
122 Draws a bar of height \texttt{value} using color \texttt{color} and
123 prints \texttt{caption} below it. By default it also prints numbers
124 \index{Numbers}
125 (values) near the top of the bar - how to change this behavior is
126 explained further on [section~\ref{sec:3.3}].
127
128 Command \verb+\drawlevellines+ draws horizontal lines and put ticks
129 with numbers along the y-axis. An important parameter in this case is
130 the \verb+\betweenticks+ \index{Parameters!betweenticks}. It
131 determines the distance between ticks (level lines) in units of
132 \texttt{yunit}. Note that the \verb+\drawlevellines+ can be issued at
133 any point inside the diagram. In this way bars can lie over (as in
134 \figref{fig:1}) or be behind the level lines.
135
136 \subsection{Adding a legend \label{sec:2.2}}
137 The next step is to add a legend to the diagram:
138 \lstinputlisting{figs/examp1b.tex}
139 The result is shown in \figref{fig:4}.
140 \begin{figure}[t]\centering
141 \input{figs/examp1b.tex}
142 \caption{\label{fig:4} Adding legend to \figref{fig:1}}
143 \end{figure}
144
145 Any legend begins with
146 \verb+\diagLegendbegin{Xupleft}{Yupleft}{width}+,
147 \index{Commands!Legend!diaglegendbegin}
148 where the first two arguments represent the upper left point of the
149 legend's bounding box (see \figref{fig:5}) and the last one its width.
150 The height of the box is calculated automatically.
151
152 \verb+\diagLegenditem{caption}{icolor}+ produces a rectangle of the
153 color \texttt{icolor} and prints \texttt{caption} next to it. To finish
154 the legend the \verb+\diagLegendend+
155 \index{Commands!Legend!diagLegendend}
156 is used. Note, that \emph{all} these coordinates are in \texttt{xunit}
157 and \texttt{yunit} units, not in \texttt{cm} or \texttt{in}!
158 \begin{figure}[t]\centering
159 \includegraphics[scale=0.5]{figs/diagleg.eps}
160 \caption{\label{fig:5} Legend-related parameters}
161 \end{figure}
162
163 Some properties of the legend can be changed using \\
164 \verb+\diagLegendoptions{framefillcolor}{framelinecolor}{framelinewidth}+
165 \index{Commands!Legend!diagLegendoptions}
166 command.
167
168 \subsection{Groups of items \label{sec:2.3}}
169 I can imagine that you need more than just bars with figures. Let me
170 introduce one more feature: grouping of items as in \figref{fig:6}.
171 \begin{figure}[t]\centering
172 \input{figs/examp2.tex}
173 \caption{\label{fig:6} Grouped items}
174 \end{figure}
175 This grouping is done using\\
176 \verb+\subbaritem{caption}{value}{color}+\index{Commands!subbaritem}. \\
177 So, a piece of code like
178 \begin{verbatim}
179 \baritem{1998}{123}{red}
180 \subbaritem{}{118}{blue}
181 \end{verbatim}
182 will produce \emph{two} bars next to each other.
183 You can go further and make groups of 3, 4, etc bars. In this way
184 \begin{verbatim}
185 \baritem{1998}{123}{red}
186 \subbaritem{}{118}{blue}
187 \subbaritem{}{108}{green}
188 \end{verbatim}
189 would produce group of 3 bars.
190
191 The ``bad news'' about \figref{fig:6} is that the labels (year)
192 are not centered anymore. To correct the situation, just issue the command
193 \verb+\barspergroup{2}+ \index{Commands!barspergroup}
194 just after the beginning of the chart. It commands
195 the \bardiag\ to place the label assuming each group of items to be 2 bars wide.
196
197 Another way of grouping items is put them on top of each other
198 as in \figref{fig:7}, where, actually, two these approaches are combined.
199 The above explained \verb+\barspergroup+ trick is used here too.
200 \begin{figure}[ht]\centering
201 \input{figs/examp3.tex}
202 \caption{\label{fig:7} Grouped items}
203 \end{figure}
204 The corresponding source code is shown below:
205 \lstinputlisting{figs/examp3.tex}
206 The command \verb+\subtopbaritem+ \index{Commands!subtopbaritem} has
207 the same arguments as other ``baritem'' commands and produces a bar on
208 top of the previous ``baritem'', which can be \verb+\baritem+,
209 \verb+\subbaritem+ or even \verb+\subtopbaritem+.
210
211 \subsection{Making a 3D frame \label{sec:2.4}}
212 Frame can be done 3-dimensional by using the switch
213 \verb+\frameTD+. Its default value is 0, however, using\\
214 \verb+\renewcommand{\frameTD}{1}+
215 \index{Switches!frameTD}
216 \\
217 a 3D frame can be forced. To control the 3D effect, parameters
218 \verb+\tdx+ and \verb+\tdy+ are used [section~\ref{sec:3.5}].
219 Here, \figref{fig:8a}, is an example of the same diagram as in
220 \figref{fig:1} but with a 3D frame
221 %
222 \begin{figure}[!ht]
223 \renewcommand{\betweenticks}{50}
224 \subfigure[3D frame]{\label{fig:8a}
225 \renewcommand{\frameTD}{1}
226 \centering
227 \input{figs/examp4.tex}
228 }
229 \subfigure[3D items]{\label{fig:8b}
230 \renewcommand{\frameTD}{0}
231 \renewcommand{\ActiveBarPrimitive}{\barTDRect}
232 \input{figs/examp4.tex}
233 }
234 \caption{\label{fig:8} 3D effects}
235 \end{figure}
236
237 \subsection{Adding shadow to the legend \label{sec:2.5}}
238 You can force the legend to have a shadow by\\
239 \verb+\newcommand{\legendShadow}{1}+\index{Switches!legendShadow}.\\
240 However, if you use a 3D frame this will be done automatically.
241
242 \subsection{Changing the item-bar shape \label{sec:2.6}}
243 The \bard package provides also 3D item-bar shapes: rectangular 3d and
244 cylindrical. In fact, all the ``bar-item'' commands, such as
245 \verb+\XXXbaritem+, call the
246 \verb+\ActiveBarPrimitive+ command to draw ``a bar''. This means that
247 you can provide your own shapes [section \ref{sec:3.3}].
248
249 Concerning the shapes, provided by \bard: \figref{fig:8b} is an
250 example of\\ \verb+\renewcommand{\ActiveBarPrimitive}{\barTDrect}+
251 \index{Shape of an item-bar}\index{Shape of an item-bar!barTDrect}
252 command.
253 The default value \index{Shape of an item-bar!default}, \verb+\barRect+,
254 \index{Shape of an item-bar!barRect} produces a flat rectangle and
255 \verb+\barCylinder+\index{Shape of an item-bar!barCylinder} a cylinder.
256 All these shapes can be grouped, etc, exactly in the same way as flat
257 rectangular bars.
258
259 The package provides: \verb+\barRect+, \verb+\barTDRect+,\verb+\barCylinder+.
260 Some additional shapes are discussed in \texttt{bardiag2.ps}.
261
262 \subsection{Adding error margins (``whiskers'')}
263 Adding ``whisker'' is simple! Just issue
264 \verb+\barerrormargins{dYdown}{dYup}+ command after
265 the corresponding
266 \verb+\baritem+ or \verb+\subbaritem+\footnote{Unfortunately,
267 it will not work with \texttt{subtopbaritem}.}.
268 \begin{lstlisting}{}
269 \baritem{1998}{123}{gray} \barerror{25}
270 \subbaritem{}{118}{lightgray} \barerrormargins{35}{15}
271 \end{lstlisting}
272 %
273 If you need symmetric whisker, use \verb+\barerror{dY}+ instead.
274 The properties of the ``whisker''-line are controlled by two parameters:\\
275 (i) \verb+\barerrorterm+ which defines the terminators. Default is
276 \verb+\newcommand{\barerrorterm}{*-|}+, as in \figref{fig:er}\\
277 (ii) \verb+barerrorstyle+ can change the color, thickness, etc; use
278 \verb+\newpsstyle+ to redefine it. Default:
279 \verb+\newpsstyle{barerrorstyle}{linewidth=2pt,linecolor=black}+.
280
281 Everything said above holds for ``horizontal'' diagrams (\texttt{bardiag1.ps})
282 as well.
283
284 \begin{figure}[t]\centering
285 %\renewcommand{\bdorientation}{\bdhor}
286 \renewcommand{\placenumber}{\bottom}
287 \renewcommand\numbercolor{\black\bf}
288 \input{figs/examp2er.tex}
289 \caption{\label{fig:er} Grouped items and ``whiskers''}
290 \end{figure}
291
292 %\lstinputlisting{figs/examp2er.tex}
293 \subsection{Pattern fillings and black-and-white documents}
294 In many cases one cannot use any colors, except grayscale: not so many
295 publications are printed in color. So, it would be handy to use patterns
296 to fill the bar-items. This is possible, because \verb+\baritem+
297 and friends take also an optional argument: style. In fact, the default one is
298 \verb+fillstyle=solid+ to get solid filled rectangles. In fact, one can call\\
299 \verb+\baritem[fillstyle=vlines*]{xxx}{nnn}{gray}+\\
300 to produce a dashed bar. To
301 get more info about fill styles, look into the \pac{pstricks} documentation:
302 e.g. \pac{psr-usr2.ps}, pp. 27--28.
303 Three of the relevant styles are: \verb+vlines*+, \verb+hlines*+, and
304 \verb+crosshatch*+. Also parameters like \verb+hatchwidth+, \verb+hatchsep+,
305 \verb+hatchcolor+, \verb+hatchangle+ can be used. Both\\
306 \verb+\baritem[fillstyle=vlines*,hatchsep=8pt,hatchangle=30]{xxx}{nnn}{gray}+\\
307 and\\
308 \verb+\newpsstyle{myfill}{fillstyle=vlines*,hatchsep=8pt,hatchangle=30}+\\
309 \verb+\baritem[style=myfill]{xxx}{nnn}{gray}+\\
310 are acceptable and produce the same.
311 \begin{figure}[t]\centering
312 %\renewcommand{\bdorientation}{\bdhor}
313 \renewcommand{\placenumber}{\bottom}
314 \renewcommand\numbercolor{\black\bf}
315 \input{figs/exampcr.tex}
316 \caption{\label{fig:cr} Using optional style argument of ``baritem'' and
317 ``diagLegenditem''}
318 \end{figure}
319 A comprehensive example to study is presented in \figref{fig:cr}:
320 \lstinputlisting{figs/exampcr.tex}
321
322 As shown in this example, the same technique applies to \verb+\diagLegenditem+.
323
324 Note, not all ``bar shapes'' will make use of the style you supply: e.g.,
325 there is no use in pattern-filled 3D cylinders because they look flat.
326 All the bar-primitives do accept the style option. It should always work well
327 for \verb+\barRect+ and \verb+\barArrowRect+. In the case of \verb+\barTDRect+
328 you can try to play around
329 -- personally, I do not see much use of it.
330 Such primitives as \verb+\barCylinder+,
331 \verb+\barGradRect+, \verb+\barGradMidRect+, \verb+\barGradCylinder+ will just
332 ignore this optional argument.
333
334
335 \subsection{Additional information \label{sec:2.7}}
336 Try to have a look at the examples, which can be found in the
337 \texttt{example} directory.
338 %
339 %#########################################
340 %
341 \clearpage
342 \mysection{A more sophisticated example \label{sec:3}}
343 See \figref{fig:9}. More examples can be found in \texttt{bardiag1.ps} and
344 \texttt{bardiag2.ps}. In \texttt{bardiag1.ps} it is also explained how
345 to draw a ``horizontally'' oriented diagram.
346
347 \begin{figure}[!ht]\centering
348 \input{figs/examp5.tex}
349 \caption{\label{fig:9} A more sophisticated example. See
350 \texttt{bardiag2.ps} for the source code.}
351 \end{figure}
352
353 \subsection{Frame properties \label{sec:3.1}}
354 \begin{enumerate}
355 \item \verb+\bardiagrambegin{#1}{#2}{#3}{#4}{#5}{#6}{#7}+
356 \index{Commands!bardiagrambegin}
357 see \figref{fig:2}
358 \begin{itemize}
359 \item[\#1] diagram height (number)
360 \item[\#2] diagram width (number)
361 \item[\#3] bottom height (length, use \texttt{cm},
362 \texttt{in},\ldots)
363 \item[\#4] bar width (number)
364 \item[\#5] distance between (groups) of bars
365 \item[\#6] x unit length (\texttt{cm},
366 \texttt{in},\ldots)
367 \item[\#7] y unit length (\texttt{cm},
368 \texttt{in},\ldots)
369 \end{itemize}
370 \item \verb+\bardiagramend{#1}{#2}+ \index{Commands!bardiagramend}
371 \begin{itemize}
372 \item[\#1] X label (text, things like \verb+\bf,\it+, color can
373 be used)
374 \item[\#2] Y label (the same)
375 \end{itemize}
376 \item Parameters to be changed using \verb+\renewcommand+:
377 \begin{itemize}
378 \item \verb+\frameTD+ \index{Switches!frameTD}
379 (default 0) can 1 or 0; makes the frame
380 3D or 2D
381 \end{itemize}
382 \item Parameters to be changed using \verb+\setlengt+:
383 \begin{itemize}
384 \item \verb+\leftshift+ \index{Lengths!leftshift}
385 (default \verb+\ticklength++2mm) is the
386 distance between the first bar and the frame left edge
387 \item \verb+\textoffset+ \index{Lengths!textoffset}
388 (default -0.2mm) see \figref{fig:2}
389 \item \verb+\captionoffset+ \index{Lengths!captionoffset}
390 (default 1.5cm) see \figref{fig:2}
391 \end{itemize}
392 \item Styles, use \verb+\newpsstyle+ to change
393 \begin{itemize}
394 \item \verb+diagframestyle+ \index{Styles!diagframestyle}
395 is style of a 2D frame; defined as\\
396 \verb+\newpsstyle{diagframestyle}{linewidth=1pt,linecolor=black,fillstyle=none}+
397 \item \verb+diagTDframestyle+ \index{Styles!diagTDframestyle}
398 is style of the foreground of a 3D frame;\\
399 \verb+\newpsstyle{diagTDframestyle}+\\
400 \verb+ {linewidth=1pt,linecolor=black,fillstyle=none}+
401 \item \verb+diagbgframestyle+ \index{Styles!diagbgframestyle}
402 is style of the background of a 3D frame;\\
403 \verb+\newpsstyle{diagbgframestyle}+\\
404 \verb+ {linewidth=1pt,linecolor=black,fillcolor=frameBGgray}+\\
405 Also the definition \verb+\definecolor{frameBGgray}{gray}{0.9}+
406 is used.
407 \end{itemize}
408 \end{enumerate}
409
410 % - - - - - - -
411 \subsection{Level lines and ticks \label{sec:3.2}}
412 Both are produced by the \verb+\drawlevellines+ command. It can be
413 issued at \emph{any} point inside a diagram.
414 \begin{enumerate}
415 \item Parameters to be changed using \verb+\renewcommand+:
416 \begin{itemize}
417 \item \verb+\betweenticks+ \index{Parameters!betweenticks}
418 is the distance between
419 ticks/level lines in units of \verb+yunit+, so no \texttt{cm}
420 allowed
421 \item \verb+\MAXnumberofticks+ \index{Parameters!MAXnumberofticks}
422 (default is 20) is the maximal
423 number of ticks/level lines allowed. If \verb+\betweenticks+
424 is so small that the number of ticks exceeds
425 \verb+\MAXnumberofticks+, the latter will be used (\bard
426 will complain however, so a warning will be issued).
427 \item \verb+\barlabelangle+ \index{Parameters!barlabelangle}
428 determines the angle of labels to be written below the
429 bars. It has to be changed \emph{after}
430 \verb+\bardiagrambegin+
431 is called, otherwise it will automatically be set to 90
432 degrees for vertical bars and 0 for horizontal ones.
433 \item \verb+\ticklabelangle+ is almost the same as
434 \index{Parameters!ticklabelangle}
435 \texttt{barlabelangle} but for the tick labels. It can
436 be set at any point, not only after the beginnig of a diagram.
437 \end{itemize}
438 \item Parameters to be changed using \verb+\setlengt+:
439 \begin{itemize}
440 \item \verb+\ticklength+ \index{Lengths!ticklength}
441 (default 2mm) is length of a tick on the y-axis
442 \item \verb+\lefttextoffset+ \index{Lengths!lefttextoffset}
443 (default \verb+\leftshift++2mm)
444 see \figref{fig:2}
445 \end{itemize}
446 \item Styles, use \verb+\newpsstyle+ to change
447 \begin{itemize}
448 \item \verb+tickstyle+ \index{Styles!tickstyle}
449 is the tick style; defined as\\
450 \verb+\newpsstyle{tickstyle}{linewidth=1pt,linecolor=black}+
451 \item \verb+levellinestyle+ \index{Styles!levellinestyle}
452 is the level line style;\\
453 \verb+\newpsstyle{levellinestyle}{linewidth=0.2pt,linecolor=blue}+
454 \end{itemize}
455 \end{enumerate}
456
457 % - - - - - - -
458 \subsection{Bars \label{sec:3.3}}
459 \begin{enumerate}
460 \item \verb+\baritem{name}{value}{color}+ \index{Commands!baritem}
461 is used to show a
462 ``bar''. Actually it calls\\ \verb+\ActiveBarPrimitive+
463 to draw the ``bar''.
464 \item \verb+\subbaritem{}{}{}+ \index{Commands!subbaritem}
465 is used to produce a bar next to the
466 previous bar (on the right hand side) without any space in between.
467 \item \verb+\subtopbaritem{}{}{}+ \index{Commands!subtopbaritem}
468 is used to produce a bar on top of
469 the previous bar.
470 \item \verb+\ActiveBarPrimitive+ \index{Commands!ActiveBarPrimitive}
471 is used by all ``baritem'' commands
472 to draw something that represents a bar. In fact, the
473 \verb+\ActiveBarPrimitive+ is just a ``pointer'' to a command, which
474 will really do the job. \bard provides 3 such commands:
475 \verb+\barRect+, \index{Commands!barRect}\index{Switches!barRect}
476 \verb+\barTDRect+, \index{Commands!barTDRect}\index{Switches!barTDRect}
477 and \verb+\barCylinder+. \index{Commands!barCylinder}\index{Switches!barCylinder}
478 Use,
479 e.g., \verb+\renewcommand{\ActiveBarPrimitive}{\barCylinder}+ to
480 draw cylinders instead of default rectangles. You can write your own
481 ``shape'' (say \verb+\mybar+)
482 and put it somewhere in the preamble of the document or in
483 the \texttt{bardiag.cfg}\index{bardiag.cfg} file and then point
484 \verb+\ActiveBarPrimitive+ to it [see \texttt{bardiag.cfg} in
485 \texttt{example} directory]. The \verb+\mybar+
486 should accept 5 arguments: (\#1,\#2) and (\#3,\#4) are coordinates
487 of the bottom-left and upper-right corners and \#5 is the color.
488 In the \texttt{bardiag.cfg} file, which can be found, e.g., in the
489 examples directory, a couple of ``alternative'' shapes are defined.
490 Examples can be found in \texttt{altdiag.tex} and in the appendix
491 (see file \texttt{bardiag2.tex} or \texttt{bardiag2.ps}).
492 %
493 \item Parameters to be changed using \verb+\renewcommand+:
494 \begin{itemize}
495 \item \verb+\shownumbers+ \index{Switches!shownumbers}
496 \index{Numbers!shownumbers}
497 (default 1) use 1 to show
498 and 0 to hide the numbers on item-bars
499 \item \verb+\numbercolor+ \index{Parameters!numbercolor}
500 \index{Numbers!numbercolor}
501 (default \verb+\black\bf+) is the
502 color of these numbers
503 \item \verb+\placenumber+ \index{Switches!placenumber}
504 \index{Numbers!placenumber}
505 (default \verb+\belowtop+)
506 determines where on the bar put the number; can be
507 \verb+\belowtop+, \verb+ \overtop+, \verb+\bottom+
508 \index{Parameters!placenumber!belowtop}
509 \index{Parameters!placenumber!overtop}
510 \index{Parameters!placenumber!bottom}
511 \end{itemize}
512 %
513 \item Parameters to be changed using \verb+\setlengt+:
514 \begin{itemize}
515 \item \verb+\numberoffset+ \index{Lengths!numberoffset}
516 (default \verb+2\textoffset+) is
517 offset of the number on a bar
518 from the top (if \verb+\overtop+ or \verb+\belowtop+
519 are used) or the bottom (if \verb+\bottom+ is used)
520 \end{itemize}
521 \end{enumerate}
522
523 % - - - - - -
524 \subsection{Legend \label{sec:3.4}}
525 \begin{enumerate}
526 \item \verb+\diagLegendbegin{}{}{}+ \index{Commands!Legend!diagLegendbegin}
527 begins a legend.
528 (\#1,\#2) is a coordinate of the top-left corner, \#3 is the width
529 of the bounding box (all in units, not is \texttt{cm} or \texttt{in}).
530 It is assumed
531 that diagram is started above. Each diagram can have any number of
532 legends.
533 \item \verb+\diagLegendend+ \index{Commands!Legend!diagLegendend}
534 ends a legend. It is needed to draw a shadow.
535 \item \verb+\diagLegendoptions{}{}{}+ \index{Commands!Legend!diagLegendoptions}
536 is used to change the legend
537 background color (\#1), frame line color (\#2), and frame line
538 width (\#3).
539 \item \verb+\diagLegenditem{}{}+ \index{Commands!Legend!diagLegenditem}
540 adds one item to the legend: \#1 is
541 text, \#2 is color. A rectangle of the color \#2 will be drawn and
542 the text \#1 printed next to it.
543 \item Parameters to be changed using \verb+\renewcommand+:
544 \begin{itemize}
545 \item \verb+\legendShadow+ \index{Switches!legendShadow}
546 (default 0) - can be 1(=show the
547 legend shadow) or 0(=do not); is switched on or off
548 automatically if the frame is 3D or 2D, but can be adjusted
549 by the final user as well
550 \item \verb+\legendShadowColor+ \index{Parameters!legendShadowColor}
551 (default \verb+legShCol+,
552 where \verb+\definecolor{legShCol}{gray}{.5}+)
553 \end{itemize}
554 %
555 \item Parameters to be changed using \verb+\setlength+:
556 \begin{itemize}
557 \item \verb+\legenditemheight+ \index{Lengths!legenditemheight}
558 (default 7mm) - see \figref{fig:5}
559 \item \verb+\legendspacer+ \index{Lengths!legendspacer}
560 (default 3mm) - see \figref{fig:5}
561 \item \verb+\legendRectWidth+ \index{Lengths!legendRectWidth}
562 (default 6mm) is width of the
563 colored rectangle; see \figref{fig:5}
564 \item \verb+\legendRectHeight+ \index{Lengths!legendRectHeight}
565 (default 4mm) is height of the
566 colored rectangle; see \figref{fig:5}
567 \end{itemize}
568 \item Styles (to be changed by \verb+\newpsstyle+)
569 \begin{itemize}
570 \item \verb+diagLegenditemstyle+ \index{Styles!diagLegenditemstyle}
571 is a style for the rectangle,
572 which appears left to the legend text; default\\
573 \verb+fillstyle=solid,fillcolor=white,linecolor=white+
574 is not supposed to be changed directly (use
575 \texttt{diagLegendoptions}), although it's up to you.
576 \item+diagLegendframetyle+ \index{Styles!diagLegendframetyle}
577 is a style for the bounding box
578 around the legend; default\\
579 \verb+fillstyle=none,linecolor=black,linewidth=0.5pt+
580 is not supposed to be changed directly (use
581 \texttt{diagLegendoptions}), although it's up to you.
582 \end{itemize}
583 \end{enumerate}
584
585 %- - - -
586 \subsection{3D effects \label{sec:3.5}}
587 \begin{figure}[!h]\centering
588 \includegraphics[scale=0.7]{figs/tddiag.eps}
589 \caption{\label{fig:3d}``Depth'' of the 3D-effect}
590 \end{figure}
591 ``Depth'' of the 3D effect is controlled by \verb+\tdx+ and
592 \verb+\tdy+ parameters
593 \index{Parameters!tdx (3D depth)} \index{Parameters!tdy (3D depth)}
594 (default - \verb+\tdx+=0.4 and \verb+\tdy+ is 5\% of the diagram height).
595 They determine the
596 ``depth'' in units of the bar width \verb+\dbar+, \figref{fig:3d}.
597 Use \verb+\renewcommand+ to change them. Note, that the \verb+\renewcommand+
598 is to be issued \emph{after} the \verb+\begindiagram+ statement.
599 %#########################################
600
601
602 \printindex
603
604 \end{document}