Thursday, March 16, 2006
st: Re: pie charts
What do you think of a stacked bar chart?
year Germany Japan USA 2000 9 6 8 2001 10 7 9 2002 11 8 10
graph bar (asis) Germany Japan USA, over(year) stack
--- Christopher.Grigoriou@unil.ch wrote: > ...I also agree with Nick and you that a legend with 229 values is > likely to be unreadable...I have cleaned my data...hence, now, with > one importing country, 13 years, and the ten first partners for > each year, "it worked", if and only if instead of defining my graph > over(partner) I defined it over(rank) that is to say over the rank > of each partner: 1, 2, ..., 10. With the rank at each year having > of course the same code (while the ten countries are different at > each year and hence have different codes), > "stata did accept" to represent the ten pies but without taking > into account the evolution of the total amount of imports. Anyway > it was just to present a kind of brief overview of my dataset... > > Many thanks for your answers > Regards > Christopher > > If you have 10 main partners in each of 10 years, then this could > not > possibly produce the 229 levels of the -partenaires- variable that > Stata > has found - it would give you at most 100, and, if some of the main > partners exist across multiple years fewer than this. You need to > drop > (or at least exclude) all records except the 10 main partners in > each > year. This would reduce your problem, but, unless it leaves 15 or > fewer > main partners across the 10 years, will not fix it. > > Another option is to define additional styles for p16pie, p17pie > etc in > your own scheme file (see -help scheme files-). For example, saving > the > text below as scheme-pietest.scheme in your ado path, and adding > the > option -scheme(pietest)- to your -graph- command will add > definitions > for a 16th slice of pie coloured bright red... > > #include s2color > areastyle p16pie p1 > color p1 red > > However, I would also agree with Nick that (1) a legend with 229 > (or > even 100) values is going to swamp your graph; and (2) pie charts > aren't > very easy to read anyway! > > David > > -----Original Message----- > From: firstname.lastname@example.org > [mailto:email@example.com] On Behalf Of > Christopher.Grigoriou@unil.ch > Sent: 15 March 2006 15:38 > To: firstname.lastname@example.org > Subject: Re: st: RE: pie charts > > In a first stage I had dropped all the partners but the ten main > partners for each year that is why there is nothing in the syntax > to > identify these partners. > I wonder if the problem is not that the ten first partners are not > the > same for each year? And even though the ten first main partners are > not > the same why stata cannot, for each year, apply the command? Isn't > there > something to do with the long or wide format of the data? > > By the way, a time series graph could be used to show the evolution > of > one particuliar partner but not of the structure contrary to a > serie of > pie charts which could, I think, both represent the distribution of > the > pie and the evolution in the size of the pie... > > Anyway thank you for your answer, > regards > Christopher > > I have three ideas here. > > 1. The variable -partenaires- evidently > has 229 categories, and Stata will be struggling to cope. > > Quite possibly all you will see is a legend and the charts > themselves > will be out of sight. > > 2. I can't see how your syntax corresponds to identifying the ten > main > partners. > > 3. Although you want a series of pie charts it is difficult for me > to > see how they will convey the structure of your data at all well. A > time > series graph appears more natural here. Stata does supply pie > charts -- > largely so nobody can say "But you can't get a pie chart in Stata!" > -- > but that doesn't make them an effective method for showing > comparative > structure over time. > > Nick > email@example.com
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/
Links to this post: