[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Philip Jones <pjones8@uwo.ca> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: re: Possible to have different colours for by() groups in histogram? |

Date |
Wed, 04 Nov 2009 07:39:36 -0500 |

Thank you again, Phil

Please do not send HTML to the list. . twoway histogram ease if group==1, color(red) gap(5) discrete freq by(group) /// || histogram ease if group == 2, color(blue) by(group, legend(off)) discrete freq xla(1/5) gap(5) Nick n.j.cox@durham.ac.ukPhilip Jones I would like to know if it is possible in Stata to have different colours for plots in histograms created using the by() option. For instance, if I would like to plot frequencies of a Likert scale about the ease of a process (from 1 to 5) in two separate groups, I can generate a nice histogram using the by() option, but both "sides" (or plots) of the graph are the same colour. For instance, input group ease 1 1 1 2 1 3 1 3 1 3 1 3 1 4 1 5 1 5 2 2 2 2 2 2 2 3 2 3 2 4 2 4 2 5 2 5 end graph twoway histogram ease, by(group) discrete frequency xtick(1(1)5) xlabel(1(1)5) gap(5) color(red)This gives me a histogram, but I would like a different colour foreachplot - say red for the plot on the left and blue for the one on the right. I am sure there is a trivial way of achieving this, but I haven't been able to find it. The barlook_options are not valid for histograms, and using the graph editor to alter the colour also results in both plots becoming the same colour.

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: re: Possible to have different colours for by() groups in histogram?***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: Kappa Weights** - Next by Date:
**st: RE: re: Possible to have different colours for by() groups in histogram?** - Previous by thread:
**WG: st: Inappropriate lines joining up between individuals in twoway line graph** - Next by thread:
**st: RE: re: Possible to have different colours for by() groups in histogram?** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |