scatter_LDS
MATLAB scatter plot function has significant problems showing large data set (e.g. 1000000 points). However, there is no much information in drawing thousands of points one on top of another. scatter_LDS reduces the amount of data shown, while preserving the isolated points.
For example, let's assume that you are conducting a study, which aim is to estimate the probability of myocardial infarction based on two metrics:
- duration of atrial fibrillation during 24 hour ambulatory ECG recording (stored in vector 'holter').
- peak ischemic ST depression during cardiac stress test (stored in vector 'ST').
Also, boolean vector 'MI' has value 'true' for those patients which experience myocardial infarction
during 5 years since the above tests. Use the following commands to initialize the variables:
>> N = 1e6;
>> t = 20*abs(randn(1,N));
>> MI = t<=5;
>> holter = max(0,min(100, 15*randn(1,N)+30+40*5./t));
>> ST = (5-2*MI).*abs(randn(1,N))+5*MI;
Now you can visualise the data using the following commands:
>> scatter_LDS(ST(~MI),holter(~MI));
>> hold on;
>> scatter_LDS(ST(MI),holter(MI),[],'r');
>> hold off
For additional explanations type: help scatter_LDS
This submission is courtesy of Norav Medical (www.norav.com) - the leading company in the fields of PC-ECG, EKG Management systems and related non-invasive cardiac devices.
Cite As
Mark Matusevich (2024). scatter_LDS (https://www.mathworks.com/matlabcentral/fileexchange/45407-scatter_lds), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.