summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/piechartmp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-09 00:45:48 +0000
committerKarl Berry <karl@freefriends.org>2006-01-09 00:45:48 +0000
commit5dc602d16c5be2fd035b254ca23484a90aebd6dc (patch)
tree72efb15fba318cc2096a8cc6999ed3fa0bff317d /Master/texmf-dist/doc/metapost/piechartmp
parentb4fc5f639874db951177ec539299d20908adb654 (diff)
doc 5
git-svn-id: svn://tug.org/texlive/trunk@81 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost/piechartmp')
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/INSTALL6
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/LEGAL104
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/README17
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.mp146
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.pdfbin0 -> 32908 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/examples/wec.mp122
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/examples/wec.pdfbin0 -> 8824 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/examples/worldmap.jpgbin0 -> 23616 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/piechartmp/piechartmp.pdfbin0 -> 316716 bytes
9 files changed, 395 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/INSTALL b/Master/texmf-dist/doc/metapost/piechartmp/INSTALL
new file mode 100644
index 00000000000..f61c9bc54ab
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/INSTALL
@@ -0,0 +1,6 @@
+piechartMP installation:
+
+piechartmp.mp --> TEXMF/metapost/piechartmp/
+LEGAL, README --> TEXMF/doc/metapost/piechartmp/
+piechartmp.pdf --> TEXMF/doc/metapost/piechartmp/
+/examples/* --> TEXMF/doc/metapost/piechartmp/
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/LEGAL b/Master/texmf-dist/doc/metapost/piechartmp/LEGAL
new file mode 100644
index 00000000000..b02acc87c0d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/LEGAL
@@ -0,0 +1,104 @@
+ piechartMP
+ Terms And Conditions For Copying, Distribution And Modification
+ Like LaTeX Project Public License Version 1.0
+
+
+WARRANTY
+========
+
+There is no warranty for piechartMP, to the extent permitted by
+applicable law. Except when otherwise stated in writing, the
+Copyright holder provides piechartMP `as is' without warranty of any
+kind, either expressed or implied, including, but not limited to, the
+implied warranties of merchantability and fitness for a particular
+purpose. The entire risk as to the quality and performance of the
+program is with you. Should piechartMP prove defective, you assume
+the cost of all necessary servicing, repair or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will the Copyright holder, or any of the individual authors named in
+the source for piechartMP, be liable to you for damages, including
+any general, special, incidental or consequential damages arising out
+of any use of piechartMP or out of inability to use piechartMP
+(including but not limited to loss of data or data being rendered
+inaccurate or losses sustained by you or by third parties as a result
+of a failure of The Program to operate with any other programs), even
+if such holder or other party has been advised of the possibility of
+such damages.
+
+
+DISTRIBUTION
+============
+
+Redistribution of unchanged files is allowed provided that all files
+that make up the distribution of piechartMP are distributed.
+In particular this means that piechartMP has to be distributed
+including the files in the piechartMP-README.
+If you distribute piechartMP together with a installation programm
+or installation programms, you have to take care, that users cannot
+skip or delete parts of piechartMP without be well informed about
+this action.
+
+The distribution of piechartMP contain a listing of all the files
+covered by this license at README.
+
+If you receive only some of these files from someone, complain!
+
+The distribution of changed versions of certain files included in the
+piechartMP, and the reuse of code from piechartMP, are allowed
+under the following restrictions:
+
+ * It is allowed only if the legal notice in the file does not
+ expressly forbid it.
+ See note below, under "Conditions on individual files".
+
+ * You rename the file before you make any changes to it, unless the
+ file explicitly says that renaming is not required. Any such changed
+ files must be distributed under a license that forbids distribution
+ of those files, and any files derived from them, under the names used
+ by the original files in the distribution of piechartMP.
+
+ * You change any `identification string' in piechartMP to clearly
+ indicate that the file is not part of the standard system.
+
+ * You change the `error report address' in any modified versions of
+ piechartMP, so that reports for files not maintained by the
+ original program maintainers are directed to the maintainers of the
+ changed files.
+
+ * You acknowledge the source and authorship of the original version
+ in the modified file.
+
+ * You also distribute the unmodified version of the file.
+
+ * You distribute an appropriate documentation.
+
+The above restrictions are not intended to prohibit, and hence do
+not apply to, the updating, by any method, of a file so that it
+becomes identical to the latest version of that file in piechartMP.
+
+========================================================================
+
+
+Conditions on individual files
+==============================
+
+The individual files may bear additional conditions which supersede
+the general conditions on distribution and modification contained in
+this file.
+
+Typical examples of files with more restrictive modification
+conditions would be files that contain the text of copyright notices.
+
+ * The conditions on individual files differ only in the
+ extent of *modification* that is allowed.
+
+ * The conditions on *distribution* are the same for all the files.
+ Thus a (re)distributor of a complete, unchanged copy of The Program
+ need meet only the conditions in this file; it is not necessary to
+ check the header of every file in the distribution to check that a
+ distribution meets these requirements.
+
+Such files are:
+
+ * LEGAL, README: You are not allowed to modify these files.
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/README b/Master/texmf-dist/doc/metapost/piechartmp/README
new file mode 100644
index 00000000000..95db7438b2b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/README
@@ -0,0 +1,17 @@
+This is the README of the piechartMP MetaPost package.
+For license informations see LEGAL.
+
+The package consists of the files:
+- README (this file)
+- LEGAL (license information)
+- piechartmp.mp (the MetaPost module)
+- piechartmp.pdf (english documentation)
+
+
+This is a BETA-release, but I believe that
+the user interface will not change anymore.
+Please send bug-reports and suggestions to:
+Jens-Uwe Morawski <morawski@gmx.net>
+
+Jens-Uwe Morawski
+May 14, 2002; piechartMP version 0.3.0 \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.mp b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.mp
new file mode 100644
index 00000000000..92d39d11126
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.mp
@@ -0,0 +1,146 @@
+%H
+%H piechartMP example - world energy consumption 2000
+%H (extended MetaFun version)
+%H Jens-Uwe Morawski, 2002
+%H
+
+
+%I this MetaPost example requires the MetaFun package
+%I (see piechartMP documentation)
+%I The purpose of this example is to show how pie-charts
+%I can be placed in a figure using the pc_Centre variable.
+%I wec-mfun.pdf in the same directory contains the final
+%I figure.
+
+
+%D This example uses the 'externalfigure' macro from
+%D the MetaFun package. If piechartMP is loaded after
+%D MetaFun then piechertMP detects MetaFun and will
+%D draw segment outsides as gradients.
+%D Since here many charts will be drawn it can cause
+%D an overflow of the MetaPost buffer-size,
+%D therefore piechertMP is loaded prior MetaFun.
+%D If the buffer-size of your MetaPost installation is
+%D large enough then you can load piechartMP after
+%D MetaFun and segment outsides will be drawn as gradients.
+input piechartmp ;
+input metafun ;
+
+%D Helvetica-Bold
+% This should work on most systems. If not, comment the next line.
+defaultfont := "phvb8r" ;
+defaultscale := 0.7 ;
+
+%D
+Scale := 5mm ;
+
+%D define some colors
+color oil_color, gas_color, coal_color, nuclear_color, water_color ;
+oil_color := (0.4, 0 , 0 ) ;
+gas_color := (0 , 0.5, 0 ) ;
+coal_color := (0.5, 0.3, 0 ) ;
+nuclear_color := (0.8, 0.8, 0.2) ;
+water_color := (0.3, 0.3, 1.0) ;
+
+
+%D define some points to place the charts
+pair place[] ;
+place[1] := (2cm,5cm) ;% North America
+place[2] := (7.5cm,3.5cm) ;% Asia
+place[3] := (5cm,5.3cm) ;% Europe
+place[4] := (6.5cm,5.8cm) ;% CIS
+place[5] := (5.6cm,4.2cm) ;% Middle East
+place[6] := (2.5cm,2.7cm) ;% South America
+place[7] := (5cm,3cm) ;% Africa
+
+
+%D
+def AChart (expr Size, Name, Place, Water, Nuclear, Coal, Gas, Oil) =
+ begingroup;
+ save label_pnt, Radius ;
+ pair label_pnt ; numeric Radius ;
+
+ % the 'Size' is the absolute energy consumption
+ % that means the 'Size' is proportional to the area
+ % of the pie-chart and not the radius.
+ Radius := (sqrt Size)*Scale ;
+
+ ResetSegments ; % documented in piechartMP Internals
+
+ if Water>0:
+ Segment(Water, "", water_color) ;
+ fi;
+ if Nuclear>0:
+ Segment(Nuclear, "", nuclear_color) ;
+ fi;
+ if Coal>0:
+ Segment(Coal, "", coal_color) ;
+ fi;
+ if Gas>0:
+ Segment(Gas, "", gas_color) ;
+ fi;
+ if Oil>0:
+ Segment(Oil, "", oil_color) ;
+ fi;
+
+ pc_Centre := place[Place] ; % documented in piechartMP Internals
+ PieChart(Radius, 0.3, 65, 90, 0) ;
+ label_pnt := SegmentPoint(1,(1,0));
+ label.top (Name & "; " & (decimal Size), label_pnt) withcolor white;
+
+ endgroup;
+enddef;
+
+
+beginfig(1);
+
+%D 'externalfigure' is a macro from the MetaFun package.
+%D It embeds the external JPG-Background, the file worldmap.jpg
+%D should be available from the same location as this
+%D MP file.
+externalfigure "worldmap.jpg" xscaled 10cm yscaled 7cm ;
+
+AChart (3.8, "North-America", 1, 2, 6, 25, 32, 35 ) ;
+AChart (3.4, "Asia/Oceania", 2, 2, 5, 46, 10, 38 ) ;
+AChart (2.6, "Europe", 3, 4, 16, 18, 20, 42 ) ;
+AChart (1.3, "CIS", 4, 2, 6, 18, 50, 24 ) ;
+AChart (0.5, "Middle East", 5, 0, 0, 0, 35, 65 ) ;
+AChart (0.5, "South-America",6 , 15, 0, 5, 15, 65 ) ;
+AChart (0.4, "Africa",7 , 0, 0, 37, 18, 45 ) ;
+
+
+%D the legend
+x := 3mm ;
+y := 2.5cm ;
+fill fullcircle scaled 2mm shifted (x,y) withcolor oil_color;
+label.rt ("Oil", (x+2mm,y)) ;
+fill fullcircle scaled 2mm shifted (x,(y-5mm)) withcolor gas_color;
+label.rt ("Gas", (x+2mm,y-5mm)) ;
+fill fullcircle scaled 2mm shifted (x,(y-1cm)) withcolor coal_color;
+label.rt ("Coal", (x+2mm,y-1cm)) ;
+fill fullcircle scaled 2mm shifted (x,(y-1.5cm)) withcolor nuclear_color;
+label.rt ("Nuclear Power", (x+2mm,y-1.5cm)) ;
+fill fullcircle scaled 2mm shifted (x,(y-2cm)) withcolor water_color;
+label.rt ("Water Power", (x+2mm,y-2cm)) ;
+
+
+%D some labels
+label.top ("(in billion t MCU)", (7cm,0)) ;
+defaultfont:="ptmbi8r" ; defaultscale:= 1.2;
+label("World Energy Consumption 2000", origin)
+ rotated 90 shifted (9.5cm,3cm) withcolor white;
+
+
+%D Next follows the grid I have used to determine the co-ordinates
+%D saved in place[]. Now it is not drawn because of the if..fi
+%D statement.
+if false:
+for i=1 upto 10:
+ draw (origin--(0,7cm)) shifted (i*1cm,0) withcolor white ;
+endfor;
+for i=1 upto 7:
+ draw (origin--(10cm,0)) shifted (0,i*1cm) withcolor white ;
+endfor;
+fi;
+endfig;
+end \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.pdf b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.pdf
new file mode 100644
index 00000000000..3b29ac5263e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec-mfun.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.mp b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.mp
new file mode 100644
index 00000000000..7f45ad33ffd
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.mp
@@ -0,0 +1,122 @@
+%H
+%H piechartMP example - world energy consumption 2000
+%H Jens-Uwe Morawski, 2002
+%H
+
+
+%I The piechartMP documentation includes many useful
+%I examples which not require MetaPost experience.
+%I In contrast this example employs many MetaPost
+%I commands and definitions. Thus it is not meant
+%I for piechart "beginners".
+%I The chief purpose of this example is to show
+%I how you can draw pie-charts with different data-sets
+%I using ResetSegments and how to save them in
+%I MetaPost pictures.
+%I The file wec.pdf in the same directory is the
+%I result of this MP-file.
+
+input piechartmp ;
+
+%D Helvetica-Bold
+% This should work on most systems. If not, comment the next line.
+defaultfont := "phvb8r" ;
+
+%D
+pair NameShift ; NameShift := (-3.5cm,0) ;
+Scale := 8mm ;
+
+%D define some colors
+color oil_color, gas_color, coal_color, nuclear_color, water_color ;
+oil_color := (0.4, 0 , 0 ) ;
+gas_color := (0 , 0.5, 0 ) ;
+coal_color := (0.5, 0.3, 0 ) ;
+nuclear_color := (0.8, 0.8, 0.2) ;
+water_color := (0.3, 0.3, 1.0) ;
+
+
+ChartCounter := 0 ;
+picture Charts[] ;
+
+%D
+def AChart (expr Size, Name, Water, Nuclear, Coal, Gas, Oil) =
+ begingroup;
+ save s , Radius ; string s ;
+
+ % the 'Size' is the absolute energy consumption
+ % that means the 'Size' is proportional to the area
+ % of the pie-chart and not the radius.
+ Radius := (sqrt Size)*Scale ;
+
+
+ s := Name & "; " & (decimal Size) & " billion t MCU" ;
+
+ ResetSegments ; % not documented in piechartMP doc
+
+ if Water>0:
+ Segment(Water, "", water_color) ;
+ fi;
+ if Nuclear>0:
+ Segment(Nuclear, "", nuclear_color) ;
+ fi;
+ if Coal>0:
+ Segment(Coal, "", coal_color) ;
+ fi;
+ if Gas>0:
+ Segment(Gas, "", gas_color) ;
+ fi;
+ if Oil>0:
+ Segment(Oil, "", oil_color) ;
+ fi;
+
+ PieChart(Radius, 0.3, 65, 90, 0) ;
+ label.lft (s, NameShift) ;
+ ChartCounter := ChartCounter + 1 ;
+ Charts[ChartCounter] := currentpicture ;
+ currentpicture := nullpicture ;
+ endgroup;
+enddef;
+
+def ShipoutCharts =
+ begingroup;
+ save h, t ; numeric h, t ;
+ h := 0 ; t := 0 ;
+ for i=1 upto ChartCounter:
+ t := ypart(ulcorner currentpicture) ;
+ h := -1*(ypart(lrcorner Charts[i])) ;
+ h := h + t + 5mm ;
+ draw Charts[i] shifted (0, (h));
+ endfor;
+ endgroup;
+enddef;
+
+beginfig(1);
+AChart (3.8, "North-America", 2, 6, 25, 32, 35 ) ;
+AChart (3.4, "Asia/Oceania", 2, 5, 46, 10, 38 ) ;
+AChart (2.6, "Europe", 4, 16, 18, 20, 42 ) ;
+AChart (1.3, "CIS", 2, 6, 18, 50, 24 ) ;
+AChart (0.5, "Middle East", 0, 0, 0, 35, 65 ) ;
+AChart (0.5, "South-America", 15, 0, 5, 15, 65 ) ;
+AChart (0.4, "Africa", 0, 0, 37, 18, 45 ) ;
+ShipoutCharts ;
+
+x := 5mm+(xpart(lrcorner currentpicture)) ;
+y := ypart(ulcorner currentpicture) ;
+
+fill fullcircle scaled 5mm shifted (x,y) withcolor oil_color;
+label.rt ("Oil", (x+5mm,y)) ;
+fill fullcircle scaled 5mm shifted (x,(y-1cm)) withcolor gas_color;
+label.rt ("Gas", (x+5mm,y-1cm)) ;
+fill fullcircle scaled 5mm shifted (x,(y-2cm)) withcolor coal_color;
+label.rt ("Coal", (x+5mm,y-2cm)) ;
+fill fullcircle scaled 5mm shifted (x,(y-3cm)) withcolor nuclear_color;
+label.rt ("Nuclear Power", (x+5mm,y-3cm)) ;
+fill fullcircle scaled 5mm shifted (x,(y-4cm)) withcolor water_color;
+label.rt ("Water Power", (x+5mm,y-4cm)) ;
+
+%D
+defaultfont:="ptmbi8r" ; defaultscale:= 2;
+label.top("World Energy Consumption 2000", (0, y+5mm)) ;
+
+endfig;
+end \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.pdf b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.pdf
new file mode 100644
index 00000000000..76deef44323
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/examples/wec.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/examples/worldmap.jpg b/Master/texmf-dist/doc/metapost/piechartmp/examples/worldmap.jpg
new file mode 100644
index 00000000000..f3c64b6d957
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/examples/worldmap.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/piechartmp/piechartmp.pdf b/Master/texmf-dist/doc/metapost/piechartmp/piechartmp.pdf
new file mode 100644
index 00000000000..89b7fc3cdb3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/piechartmp/piechartmp.pdf
Binary files differ