MATLAB Answers

Contourf and a background image: how set transparency ?

123 views (last 30 days)
Mario Cilento
Mario Cilento on 13 Jan 2017
Answered: Jeff Barton on 22 Oct 2019
Hello everyone. I have a contourf plot and I need to add in the same figure, as background image, a map. The issue is enhance trasparency of contourf layers.
I try to use my own code, helped by these forum, reported here:
% plotting image and contourf
img = imread('backgroud.png');
hold on;
% setting trasparency
set(c, 'Renderer', 'OpenGL');
alphable = findobj(h, '-property', 'FaceAlpha');
set(alphable, 'FaceAlpha',0.5);
Even though the command 'Renderer' is applied directly to countourf's handles, this error occurs:
The name 'Renderer' is not an accessible property for an instance of class
I'm working on a Matlab 2015b.


Sign in to comment.

Answers (1)

Jeff Barton
Jeff Barton on 22 Oct 2019 has the solution (which involves FacePrims field):
(See "Customizing the color" section)


Sign in to comment.

Sign in to answer this question.