MathGroup Archive 2008

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

Search the Archive

Re: Coloring Histograms

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93694] Re: [mg93659] Coloring Histograms
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sat, 22 Nov 2008 06:11:32 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200811211031.FAA05235@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

With Mathematica 7.0... First, you don't need to load any package at 
all.  Next, something like

   Histogram[RandomReal[NormalDistribution[0, 1], 100]]

will still give you the default uniform blue.  But the option ChartStyle 
allows you to change this. E.g.,

   Histogram[RandomReal[NormalDistribution[0, 1], 100],
      ChartStyle -> Red]

changes that blue to red.  The option ChartElementFunction allows 
different effects to be applied to the bars, e.g.:

   Histogram[RandomReal[NormalDistribution[0, 1], 100],
      ChartStyle -> Red, ChartElementFunction -> "GlassRectangle"]

See the on-line documentation.

Richard Trilling wrote:
> I'm using the Histogram package, calling it by: Needs["Histograms`"]
> 
> Each histogram keeps coming out in pale blue. I'd like to be able to change 
> the color of an individual histogram to something else.
> 
> This way when I combine two histograms on the same graph using "Show" they 
> will come out in different colors.
> 
> To plot a single histogram I use the syntax:
>       Histogram[completeness, FrequencyData -> True]
> 
> I haven't found a plot option that will acomplish this. Any ideas would be 
> appreciated.
> 
> Richard
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Linear algebra with generic dimensions
  • Next by Date: Re: Mathematica 7 is now available
  • Previous by thread: Coloring Histograms
  • Next by thread: Re: Coloring Histograms