RE: Does Mathematica do transparent colors?
- To: mathgroup at smc.vnet.net
- Subject: [mg31333] RE: [mg31318] Does Mathematica do transparent colors?
- From: "tgarza01 at prodigy.net.mx" <tgarza01 at prodigy.net.mx>
- Date: Sun, 28 Oct 2001 03:07:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I see your point, and my first guess is that you are asking for something which, if not too difficult, it takes a lot of labor, and may not be worthwhile. A single graphics object has to be constructed out of two different ones, in order to attain that "translucency" you want. When you use Show[a1,a2] to display two plots, even with colors that look very transparent, a1 overrides whatever happens to be beneath. But I wonder if the following appoach could be useful to you:
In[1]:=
<<Graphics`Graphics`;
<<Statistics`ContinuousDistributions`;
<<Statistics`DiscreteDistributions`;
<<Graphics`FilledPlot`;
In[3]:=
bern=BinomialDistribution[10,0.5];
norm=NormalDistribution[6,Sqrt[2.5]];
In[5]:=
bc=BarChart[Transpose[{Table[PDF[bern,j],{j,0,10}],Range[0,10]}],
BarStyle->GrayLevel[0.9],DisplayFunction->Identity];
In[6]:=
fp=FilledPlot[PDF[norm,x],{x,0,11},DisplayFunction->Identity];
In[7]:=
Show[fp,bc,DisplayFunction->$DisplayFunction];
This, I'm afraid, is as good as it gets, unless you want to do a good deal of tampering with the graphics objects.
Tomas Garza
Mexico City
Original Message:
-----------------
From: Ronald Bruck bruck at math.usc.edu
To: mathgroup at smc.vnet.net
Subject: [mg31333] [mg31318] Does Mathematica do transparent colors?
Subject says it all. I'd like to have translucent colors, so that I
can see one object underneath another. Is there any way to do this in
Mathematica?
For example, I'd like to plot a bar chart of e.g. a binomial
distribution and overlay it with a filled plot of the corresponding
normal distribution--but still be able to see the bars, underneath.
--Ron Bruck
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .