How To Create A Persistence Plot
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
DrEamonn
am 9 Aug. 2020
Kommentiert: Star Strider
am 11 Aug. 2020
I have quite a large data set that I want to visulaise by overlaying all the traces on one plot, with the traces only using one colour & the opacity/brightness of the resulting trace determined by how many instances of a particular value occur at each point - the only thing I can think to compare it to would be persistence on an old school oscilloscope.
Can someone point me to the correct plot type to achieve this or help me out with some code?
Thanks
5 Kommentare
Adam Danz
am 10 Aug. 2020
Bearbeitet: Adam Danz
am 10 Aug. 2020
As far as I know you cannot vary the transparency within a patch. However, you can adjust the color (ie, shades of blue) and then set a constant transparency value.
Here's some background info on controlling the color transitions of a patch by setting the CData property of a patch object. You can set a colormap from light blue to dark blue.
Akzeptierte Antwort
Star Strider
am 10 Aug. 2020
Perhaps something like this:
x = linspace(0, 10, 250); % Create Data
y = randn(10,1) .* sin(2*pi*x + randn(10,1)); % Create Data
figure
plot(x, y) % Original Waveforms
grid
colMin = min(y);
colMax = max(y);
colMean = mean(y);
figure
plot(x, colMean) % Data Mean
hold on
patch([x fliplr(x)], [colMin fliplr(colMax)], 'b', 'FaceAlpha',0.2, 'EdgeColor','none') % Shaded Range
hold off
grid
producing:

This can likely be changed to show other results.
.
10 Kommentare
Star Strider
am 11 Aug. 2020
‘Why is the highest value on the second plot higher than the first if it is plotted using the same data?’
My code creates the gradients with reference to the standard deviations of the data, going from -3 to +3, corresponding to probabilities of the data being in that range of 0.0013499 to 0.9986501, so a probability of 0.005 that the data will be included within those limits. If you prefer that they have different limits, set ‘stdMult’ to a different range, perhaps using linspace:
stdMult = linspace(-2, 2, 15);
The limits must be symmetrical, and an odd number of elements appears to work best. You can experiment with and design the probabilities using normcdf (that will produce the associated probabilities from the elements of ‘stdMult’) and norminv (that will produce the limits for ‘stdMult’ from the chosen probability).
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



