Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opacity on Matlab patch elements #472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

graille
Copy link

@graille graille commented Dec 23, 2021

NOTE: I reopened the pull request after a fail in branch selection. Old one can be deleted

Currently, patch elements don't have any opacity. So, when using a patch with an alpha layer, it just appears as a plain color.
To fix this, I added a management of the alpha layer using rgba instead of rgb when it is available.

Example with a simple code using obw function (built-in function which add a patch on the frequency area containing 99% of signal energy).

close all;
figure;
nSamp = 1024;
Fs = 1024e3;
SNR = 40;
rng default

t = (0:nSamp-1)'/Fs;

x = chirp(t,50e3,nSamp/Fs,100e3);
x = x+randn(size(x))*std(x)/db2mag(SNR);
obw(x, Fs);
title('test');
grid on;

p = fig2plotly;

Before :
before

After :
After

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant