0

I am using matplotlib's pcolormesh for 2D plotting of large sets of X Y Z data where Z is the color intensity.

I get the plots I want, but as the data is getting larger, the plotting gets slower and slower (> 30 min for each plot).

Is there any way to go about this limitation?

xaratustra
  • 647
  • 1
  • 14
  • 28
  • 1
    Maybe you can consider plotting a smaller dataset. Usually it does not make sense to plot more points than the resolution of your screen or printer would allow for anyways. – ImportanceOfBeingErnest Jun 18 '18 at 16:54
  • My problem is that in my data set some global structures in the spectrum is visible only in large plots. The best would be to plot everything in a single plot, since it would cause a single scaling for everything. Plotting into different pictures would cause slightly different color scaling. – xaratustra Jun 19 '18 at 08:58
  • 1
    Sure. But how large is "large"? If the aim is e.g. to show a plot on a usual HD screen, you would need a maximum of roughly 2000 x 1000 =2 Million pixels. Plotting a pcolormesh with 2 Million pixels takes much less than a second. So something with your code is wrong or you're plotting too many (unneeded, because not displayable) pixels. – ImportanceOfBeingErnest Jun 19 '18 at 09:34
  • Currently 7681 x 10000 which is nearly 8 million points. and that is just half an hour of data. The data set is several hours long. :-( – xaratustra Jun 19 '18 at 09:45
  • That's my point: You do not want to plot every single point if at the end several points are mapped to the same pixel on screen. Rather use a corser grid and average the data to it before plotting. – ImportanceOfBeingErnest Jun 19 '18 at 09:53

0 Answers0