Washed out colors when reproducing 2017 figure

43 Views Asked by At

In April 2017 I used the following code to produce the following figure:

    plt.clf()
    plt.imshow(result, cmap = 'hot', aspect = 'equal')
    plt.colorbar()
    plt.axis('off')
    plt.savefig('p1.png')

April 2017 figure

Here result is a 500 x 500 numpy array of floats in the range 0.55 to 0.6.

I wished to reproduce the figure at a larger resolution (using dpi = 200 in savefig) but when re-running the same code the colors look far worse, among other differences which I am not concerned about. Notably the black region of the data doesn't look black at all, and the colors look unsaturated and washed out:

October 2023 figure

Strangely the colorbar to the right looks unchanged; and I don't think the hot cmap has changed in the last 6 years. Just the figure colors are changed. It is possible aspects of my matplotlib (current version: 3.7.2) system configuration have changed. Maybe there is some gamma correction setting somewhere that I had used in 2017 and have forgotten about since.

I would like to recreate the 2017 appearance of this figure, or failing that, improve the appearance of the colors (eg so that the colors in the figure are better saturated).

0

There are 0 best solutions below