# Tag Info

3

Personally I would set such a simple data set as a plain table rather than a pie chart, but assuming we do want to do this as a pie chart, I recommend reading the manual available on CTAN carefully. Here's a slightly simpler way to achieve what I think you might want: prologues := 3 ; outputtemplate := "%j-%c.eps"; input piechartmp; beginfig(1); ...

1

The actual problem here is that the default font used by Metapost is cmr10 which has the plain TeX textfont0 encoding; since this does not have a space at code point 32 this is a particularly poor choice! You can fix this by changing the default font to one that has a more useful encoding. Try adding this at the top of your file: defaultfont := ...

2

According to the LaTeX Graphics Companion (Second edition) itself, p. 174 and 175, you should insert a line like the following: SetupText(1, "", ""); This one tells PieChartMP to use TeX as typesetting engine and so solves the problem explained above by Andrew Kepert: the space string character is now appropriately handled by TeX. See the LGC2 for further ...

3

The trouble is that when Metapost converts a string into a picture, it just does it in the simplest possible way, turning each ascii code in the string to the appropriate glyph (also using the font metric, I guess). With a TeX font, the space character (ASCII 32) is not needed for typesetting, so it is used for a funny little diagonal dash thing, which ...

3

You should insert the following lines at the beginning of your MetaPost file: prologues := 3; outputtemplate := "%j-%c.eps"; The second line will change the name example.1 into example-1.eps and make the EPS file more easily handled as such by external programs. The first one allows complete font inclusion in your resulting EPS file, which is better in ...

6

You should include your drawing code into the beginfig()… endfig flags and end your file with the end instruction, otherwise nothing will be produced. input piechartmp; beginfig(1); SetupColors((.7,.7),this,this); SetupPercent(this, " %"); Segment(50,"Lions"); Segment(30,"Tigers"); Segment(10,"Hyaena"); Segment(20,"Monkeys"); Segment(20,"Warthogs"); ...

8

New Answer Actually I prefer circle over rectangle \tikzset{ c/.style={violet}, a/.style={olive}, er/.store in=\er,er=.2, nodes={white,font=\Huge} } \def\msm#1#2{\pgfmathsetmacro#1{#2}\xdef#1{#1}} \makeatletter \def\salt{\pgfutil@ifnextchar[{\saltopt}{\saltopt[]}} \def\saltopt[#1]#2^#3+#4Å#5^#6-#7Å{{ \tikzset{#1,#2/.try,#5/.try} ...

Top 50 recent answers are included