How To Create A Persistence Plot
28 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Adam Danz
2020 年 8 月 10 日
編集済み: Adam Danz
2020 年 8 月 10 日
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.
採用された回答
Star Strider
2020 年 8 月 10 日
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 件のコメント
Star Strider
2020 年 8 月 11 日
‘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).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!