Debian Codegraph @

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

raw
1 \def\onecol{red}
2 \def\onetopcol{blue}
3 \def\twocol{red}
4 \def\twotopcol{blue}
5 \def\threecol{red}
6 \def\threetopcol{blue}
7 %-------------------------------------------------------
8 %This is the way to redefine styles
9 % \newpsstyle{mytickstyle}{linewidth=1pt,linecolor=blue}
10 %
11 % Style of the foreground frame
12 \newpsstyle{diagframestyle}{linewidth=1pt,linecolor=black,fillcolor=white}
13 % Style of the background frame
14 \newpsstyle{diagbgframestyle}{linewidth=1pt,linecolor=black,fillcolor=yellow}
15
16 % Use 3D bars
17 \renewcommand{\ActiveBarPrimitive}{\barTDRect}
18 % Make frame 3D
19 \renewcommand{\frameTD}{1}
20
21 % Put ticks and levellines each 10 yunits
22 \renewcommand{\betweenticks}{10}
23
24 % Color of the numbers on the bar-items
25 \renewcommand\numbercolor{\white\bf}
26 % Where to put the number. Can be \bottom,\belowtop,\overtop
27 \renewcommand{\placenumber}{\bottom}
28
29
30 % override the default \tdx and \tdy
31 \renewcommand{\tdx}{1.2} % depth of 3d
32 \renewcommand{\tdy}{6}
33
34 % Start the diagram
35 \bardiagrambegin{14}{100}{3cm}{1}{5}{0.8cm}{0.1cm}
36 % To draw ``years'' at 45 degrees
37 \renewcommand{\barlabelangle}{45}
38 \baritem{1990}{32}{\onecol}
39 \subtopbaritem{}{40}{\onetopcol}
40 \subbaritem{2000}{20}{\twocol}
41 \subtopbaritem{}{30}{\twotopcol}
42 \subbaritem{2010}{13}{\threecol}
43 \subtopbaritem{}{50}{\threetopcol}
44 %---
45 \baritem{1990}{21}{\onecol}
46 \subtopbaritem{}{60}{\onetopcol}
47 \subbaritem{2000}{25}{\twocol}
48 \subtopbaritem{}{64}{\twotopcol}
49 \subbaritem{2010}{58}{\threecol}
50 \subtopbaritem{}{32}{\threetopcol}
51 %---
52 \baritem{1990}{22}{\onecol}
53 \subtopbaritem{}{19}{\onetopcol}
54 \subbaritem{2000}{12}{\twocol}
55 \subtopbaritem{}{18}{\twotopcol}
56 \subbaritem{2010}{9}{\threecol}
57 \subtopbaritem{}{12}{\threetopcol}
58 \drawlevellines
59 % Legend
60 % Let's make the background white
61 % and gray frame-line of 0.5pt
62 \diagLegendoptions{white}{gray}{0.5pt}
63 %
64 \renewcommand{\legendShadowColor}{darkyellow}
65 %
66 \diagLegendbegin{10.3}{89}{3}
67 \diagLegenditem{girls}{\onecol}
68 \diagLegenditem{boys}{\onetopcol}
69 \diagLegendend
70 % End of the legend
71 \bardiagramend{\parbox{11cm}{\vspace{-1.5cm}\hspace{-1cm}
72 \begin{tabular}{p{3.2cm}p{4.0cm}p{3.2cm}}
73 \centering Alpha's & \centering Beta's & \centering Gamma's
74 \end{tabular}
75 \\[0.4cm]
76 \centering \large Year}}
77 {\large Graduated (\%)}