Re: printing problem with very simple application
- To: mathgroup at smc.vnet.net
- Subject: [mg100285] Re: [mg100265] printing problem with very simple application
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 31 May 2009 06:33:12 -0400 (EDT)
- Reply-to: hanlonr at cox.net
Include Print in definition of dumpEthn and suppress output when calling dumpEthn. dumpEthn[ctry_String] := Module[ {leg, dat, cData}, cData = CountryData[ctry, "EthnicGroupsFractions"]; If[Head@cData == ToExpression["CountryData"], Return[Print["Invalid Country(" <> ctry <> ")"]]]; If[MatchQ[cData[[1, 2]], _Missing], Return[Print["Missing fraction data for " <> ctry]]]; leg = #[[1]] & /@ cData; dat = #[[2]] & /@ cData; Print[ PieChart[dat, ChartLegends -> leg, PlotLabel -> "Ethnic groups in " <> ctry]]] dumpEthn[#] & /@ CountryData["Asia"]; This works on my Mac when I print the result to a PDF. Bob Hanlon ---- congruentialuminaire at yahoo.com wrote: ============= Hello MathGroup: I have this exceeding simple Mathematica program: dumpEthn[ctry_String] := Module[ {leg , dat, cData}, cData = CountryData[ctry, "EthnicGroupsFractions"]; If[Head@cData == ToExpression["CountryData"] , Return["Invalid Country(" <> ctry <> ")"]]; If[MatchQ[cData[[1, 2]], _Missing] , Return["Missing fraction data for " <> ctry]]; leg = #[[1]] & /@ cData; dat = #[[2]] & /@ cData; PieChart[dat , ChartLegends -> leg , PlotLabel -> "Ethnic groups in " <> ctry ] ] I invoke it thusly: dumpEthn[#] & /@ CountryData["Asia"] It produces a bunch of PieCharts. When I print it is gives 50 *blank* pages. When I Save-As-PDF, I get 50 *blank* pages. A single pie chart seems to print, i.e. dumpEthn["Iran"]. I reported this to WRI support. Can anyone suggest any other work-around on this? In the excitement about W|A, I wanted to show this to someone. TIA and I am running 7.0.1/XPSP3. Regards.. Roger Williams Franklin Laboratory http://www.meetup.com/The-San-Francisco-Math-Meetup-Group/