Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10418

Re: SmoothHistogram and Legends

From "djmpark" <djmpark@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: SmoothHistogram and Legends
Date 2012-06-10 06:17 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jr1e5k$769$1@smc.vnet.net> (permalink)
References <699541.29032.1339226519200.JavaMail.root@m06>

Show all headers | View raw


There is probably a way to do this in regular Mathematica that someone will
show you. But since you indicate that you have searched and not found a
working method I will make a custom graphic using the Presentations
Application. I do the first example in SmoothHistogram/Scope/Data.

<< Presentations` 

ShowLegend[
 Draw2D[
  {MapThread[(SmoothHistogram[
        RandomVariate[NormalDistribution[#1, 1/#1], 10^4],
        PlotStyle -> #2,
        Filling -> Axis,
        FillingStyle -> Opacity[0.5, Blend[{#2, White}, 0.5]]] // 
       DrawGraphics) &,
    {Range[4], {Blue, Magenta, Brown, Green}}]},
  AspectRatio -> 1,
  PlotRange -> {0, 1.6},
  Axes -> True],
 
 {{{Blue, "Curve 1"},
   {Magenta, "Curve 2"},
   {Brown, "Curve 3"},
   {Green, "Curve 4"}},
  LegendPosition -> {-1.1, 0.6},
  LegendSize -> {0.7, 0.3},
  LegendTextOffset -> {-0.6, 0},
  LegendSpacing -> 0.6},
 BaseStyle -> {FontSize -> 12, FontWeight -> "Bold"}] 

I used the ShowLegend statement, MapThread to construct each curve, and the
DrawGraphics command to pick off the graphics primitives. It would be nice
if WRI made available the canonical list of colors and fills they use with
multiple curves.


David Park
djmpark@comcast.net 
http://home.comcast.net/~djmpark/index.html 



From: dangoogle@warp-7.com [mailto:dangoogle@warp-7.com] 


I am trying to put a legend on a SmoothHistogram that I generate
(Mathematica 8), using an array of 6 data sets.  I can not find a single
method for making a legend on a SmoothHistogram.  All of the methods that
work with other charts and graphics don't seem to work with a
SmoothHistogram.  Has anyone accomplished this?

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: SmoothHistogram and Legends "djmpark" <djmpark@comcast.net> - 2012-06-10 06:17 +0000

csiph-web