Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: printing problem with very simple application

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100291] Re: printing problem with very simple application
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Sun, 31 May 2009 06:34:24 -0400 (EDT)
  • References: <gvq0f8$n3e$1@smc.vnet.net>

Hi Roger,

A workaround would be to add //Column after the invocation of your
function. At least, it works for generating a PDF. Have not tried
printing it.

I can confirm that in the original version a blank PDF is obtained.

BTW the part

>   leg = #[[1]] & /@ cData;
>   dat = #[[2]] & /@ cData;

in your function is a complicated way to address certain columns in
your data (although cData actually contains rules instead of lists).
In my opinion, a prettier version would be

leg = cData[[All, 1]];
dat = cData[[All, 2]];

Cheers -- Sjoerd


On May 30, 3:00 am, congruentialumina... 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 Laboratoryhttp://www.meetup.com/The-San-Francisco-Math-Meetup-Gr=
oup/



  • Prev by Date: Re: problem writing debugging utility function
  • Next by Date: Re: problem writing debugging utility function
  • Previous by thread: Re: printing problem with very simple application
  • Next by thread: Re: printing problem with very simple application