How to | Add Transparency to Plots

Transparency is useful in plots when you need an unobstructed view of multiple components of one plot, or simply want to lighten a single plot component against a white background. Mathematica uses the graphics directive Opacity to apply transparency to graphics objects. Opacity can be used with most visualization functions.

Here is a 2D plot:

In[50]:=
Click for copyable input
Out[50]=

Use the PlotStyle option with Opacity to make the plot 70% transparent:

In[51]:=
Click for copyable input
Out[51]=

Here is a 3D plot:

In[1]:=
Click for copyable input
Out[1]=

Make the plot 60% transparent:

In[2]:=
Click for copyable input
Out[2]=

Add different transparency settings for plots of multiple functions:

In[54]:=
Click for copyable input
Out[54]=

Here is a 2D region determined by two inequalities:

In[55]:=
Click for copyable input
Out[55]=

Make the plot 50% transparent:

In[56]:=
Click for copyable input
Out[56]=
    

Use Opacity to see the inner parts of a plot:

In[4]:=
Click for copyable input
Out[4]=

Use the ContourStyle option of ContourPlot3D with Opacity:

In[5]:=
Click for copyable input
Out[5]=
    

You can also add transparency to graphics.

Make a 75% transparent disk:

In[21]:=
Click for copyable input
Out[21]=

Opacity can have values between 0 and 1, with 0 corresponding to perfect transparency:

In[42]:=
Click for copyable input
Out[42]=

Use Opacity with a color:

In[41]:=
Click for copyable input
Out[41]=
    

Opacity interacts well with other Mathematica functions:

New to Mathematica? Find your learning path »
Have a question? Ask support »