From b1a8a8460dcb57e21add97d650d90b434509f5e6 Mon Sep 17 00:00:00 2001 From: Thibault PIANA Date: Thu, 23 Dec 2021 02:44:43 +0100 Subject: [PATCH] Add opacity on Matlab patch elements --- plotly/plotlyfig_aux/helpers/extractPatchFace.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plotly/plotlyfig_aux/helpers/extractPatchFace.m b/plotly/plotlyfig_aux/helpers/extractPatchFace.m index 93886e47..05d6b0b4 100644 --- a/plotly/plotlyfig_aux/helpers/extractPatchFace.m +++ b/plotly/plotlyfig_aux/helpers/extractPatchFace.m @@ -28,8 +28,11 @@ %-paper_bgcolor-% col = 255*patch_data.FaceColor; - marker.color = ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']; - + if ~isempty(patch_data.FaceAlpha) && isnumeric(patch_data.FaceAlpha) + marker.color = ['rgba(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ',', num2str(patch_data.FaceAlpha), ')']; + else + marker.color = ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']; + end else switch patch_data.FaceColor