[Matplotlib-users] Why are these plots different?

Henry Ekene sunshine.e4u at gmail.com
Fri Aug 9 14:49:12 EDT 2019


Thank you so much! Bruno, Elan Ernest, and Ben Root, you guys are
wonderful! I added the matplotlib's "classic style" option as
suggested by Bruno, and to my surprise, it worked!

On the other hand, the "jet" colormap as an added argument, suggested
by Elan Ernest also produced what I was looking for. Meanwhile, I've
also taken note that the result produced by the "jet" colormap may be
misleading, the reason for its discontinued use as the default, as
explained by Ben and Elan.

You saved the day for me! And I've learnt a great deal from you guys.

God bless you all!
Henry

On 8/9/19, Elan Ernest <elch.rz at ruetz-online.de> wrote:
> The first plot uses the `jet` colormap, the second one the `viridis`
> colormap. You can set the colormap via the `cmap` argument
> (contourf(..., cmap="jet"))
>
> Note however, that we (more or less strongly) discourage the use of the
> jet colormap for heatmaps like this. This plot makes up a nice example
> for why: The jet colormap results in "features" being seen in the data,
> which aren't actually there.
>
> For more, check
>
> * the colormaps tutorial
> (https://matplotlib.org/3.1.1/tutorials/colors/colormaps.html),
>
> * the API change note
> (https://matplotlib.org/users/dflt_style_changes.html?highlight=jet%20viridis#colormap),
>
> * this stackoverflow question
> https://stats.stackexchange.com/questions/223315/why-use-colormap-viridis-over-jet
>
>
>
> Am 09.08.2019 um 16:54 schrieb Henry Ekene:
>> Hello, Matplotlib Users,
>>
>> My challenge is that I saw this below image somewhere
>> Screenshot from 2019-08-09 15-24-34.pngand i decided to reproduce it
>> using the same matplotlib codes but it turned out that my own image
>> appear different as can be seen below
>> Screenshot from 2019-08-09 15-28-38.pngPlease why is mine different in
>> color, and what can I do to get the exact image as the other one?
>> Thanks for your help.
>>
>> Henry
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>


More information about the Matplotlib-users mailing list