Re: SmoothHistogram and Legends
- To: mathgroup at smc.vnet.net
- Subject: [mg126824] Re: SmoothHistogram and Legends
- From: "djmpark" <djmpark at comcast.net>
- Date: Sun, 10 Jun 2012 02:16:22 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <699541.29032.1339226519200.JavaMail.root@m06>
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 at comcast.net http://home.comcast.net/~djmpark/index.html From: dangoogle at warp-7.com [mailto:dangoogle at 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?