No transparency in Livescript

3 views (last 30 days)
Duijnhouwer on 21 Feb 2021
Commented: Adam Danz on 23 Feb 2021
I use RBGA values to get transparency in plots using Matlab 2020a.
This works fine in regular code but I noticed that in Livescript, the color renders as completely opaque no matter what I set the opacity value A too. This example code,
plot([0 1],[0 1],'-','Color',[1 0 0 .25],'LineWidth',20);
hold on
plot([0 1],[1 0],'-','Color',[1 0 0 .25],'LineWidth',20);
title(sprintf("renderer = %s",get(gcf,'renderer')))
when run as regular code from the draws two red bars with transparency visible where they cross (Figure 1).
However, when run it as a Livescript it produces two 100%-opaque bars, (Figure 2). Is this a know shortcoming? Is there a workaround?
Adam Danz
Adam Danz on 23 Feb 2021
I have the same results (windows 10, r2020b update 4) using opengl hardward and software. I see expected behavior outside of mlx but no transparency within mlx.
Keep in mind this style of line transparency is undocumented so that challenges the notion of expected behavior.
The three (undocumented) properties that control transparency of line objects appear to be set correctly when produced in an mlx file. Even when I set those values after the lines are rendered, there is no effect.
h(1) = plot([0 1],[0 1],'-','Color',[1 0 0 .25],'LineWidth',20);
% ans =
% 4×1 uint8 column vector
% 255
% 0
% 0
% 64
% ans =
% 'truecoloralpha'
% ans =
% 'object'

Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by