Version (193 KB) by Robert
Sets opacity of axes children


Updated 6 Sep 2016

From GitHub

View License on GitHub

MAKETRANSPARENT(h,alpha) sets the transparency of the objects referenced
by h (or the children if the object is an Axes) to alpha.
h: an axes handle (does all children) or specific line handle(s)
alpha: the opacity in [0,1] or [] (see below).
Sets the line and marker face opacity and add listener to reset them
in case they are redrawn automatically by MATLAB.
Use alpha = [] to remove the listeners. Note that this will not
revert the transparency automatically.
x = linspace(0,100,1000);
y1 = sin(x/10)+randn(size(x))/2;
y2 = sin(x/10);
h = plot(x,y1,'o',x,y2,'-');
Requires R2014b or newer (HG2)
Inspired by Yair Altman's

Cite As

Robert (2023). maketransparent (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Graphics Object Properties in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Connected to github

Added image

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.