PythonPlot: use imshow instead of pcolormesh for heatmaps

maltee1
Thu, 15 Aug 2024 09:16:14 +0000
General Usage

I have heatmaps to plot with julia. I sometimes use the plotlyjs backend to zoom portions of the plot, but for export I use pythonplot because all other backends I’ve tried either have problems (e.g. can’t do logarithmic scaling of the colorbar, lack of features I need) or just don’t look good.

The problem is that pythonplot’s heatmap seems to use pcolormesh, which turns every datapoint into a colored rectangle. With around 100 000 data points, that’s really slow, rendering the plot unusable. My current workaround is to plot using both pythonplot and gr, then delete the colored rectangles in inkscape and copy over and scale the bitmap from the gr plot. That may take 10-15 minutes because inkscape freezes for a few minutes every time I try to do something.

Is it possible to instead use imshow, but otherwise using the same commands? It should be possible to achieve the same layout and apperance. I really don’t want to use matplotlib directly, its syntax is unwieldy and incompatible with everything else, which I want to optionally use as well.

Cheers,
Malte

14 posts - 4 participants