imagesc Vs pcolor Vs contourf for large arrays?
Afficher commentaires plus anciens
I have an array that’s 32000x1001 and want to plot it using one of the listed functions. As you’d expect they all take a very long time and are very slow. my question is 2 parts: firstly how to speed them up? And second which works best?
3 commentaires
Walter Roberson
le 24 Mar 2024
I would expect that imagesc is fastest, then pcolor, with contourf being slowest.
I do not expect the results to look great -- you have at least a 10:1 reduction in pixels to fit 32000 pixels in probably about 2560-ish vertical pixels on the display.
Mathieu NOE
le 25 Mar 2024
considering the resolution of your screen, which is way below the amount of data you want to display , what about doing some downsampling of the 32000 rows ?
Adam Danz
le 25 Mar 2024
An alternative along the lines of what Mathiew Noe is recommending, you could try using histogram2 or binscatter. But as others have mentioned, the ratio of your data may result in some charts that are difficult to read.
Réponses (1)
Benjamin Kraus
le 25 Mar 2024
Modifié(e) : Benjamin Kraus
le 25 Mar 2024
0 votes
My recommendation would be to use imresize to reduce the number of rows/columns in your array before you plot it.
Whether you use imresize or not, as other have mentioned, because your screen doesn't have 32,000 pixels horizontally or vertically, the picture you see on the screen will have to be downsampled somehow. If you use imresize you control the method used for the downsampling, and you have a large range of options. This will likely be faster than relying on the imagesc command to do the downsampling, and imagesc offers only two choices for how to do the downsample (rather than the 8 or so options offered by imresize).
Catégories
En savoir plus sur Read, Write, and Modify Image dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!