Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding colormaps?

65 views
Skip to first unread message

Martin Schöön

unread,
Jan 18, 2017, 4:41:45 PM1/18/17
to
Is there a way to add colormaps to Matplotlib?

What I would like to do is to add the perceptually uniform
sequential colormaps introduced in version 1.5.something.
I would like to do this without breaking my Debian system
in which Matplotlib version 1.4.2 is the newest version
available in the repo.

/Martin

Martin Schöön

unread,
Jan 21, 2017, 3:42:40 PM1/21/17
to
Den 2017-01-21 skrev Gilmeh Serda <gilmeh...@nothing.here.invalid>:
> On Wed, 18 Jan 2017 21:41:34 +0000, Martin Schöön wrote:
>
>> What I would like to do is to add the perceptually uniform sequential
>> colormaps introduced in version 1.5.something. I would like to do this
>> without breaking my Debian system in which Matplotlib version 1.4.2 is
>> the newest version available in the repo.
>
> Haven't checked, but I assume you can get the source. Compile it but
> don't install it and then use the result in virtualenv, maybe?
>
I am hoping for directions to a config file to download and place
somewhere...

/Martin

blue

unread,
Jan 23, 2017, 5:38:15 AM1/23/17
to
you have here a full example , for another version not significant changes:
http://matplotlib.org/examples/color/colormaps_reference.html

Martin Schöön

unread,
Jan 23, 2017, 2:58:03 PM1/23/17
to
Den 2017-01-23 skrev blue <catal...@gmail.com>:
> you have here a full example , for another version not significant changes:
> http://matplotlib.org/examples/color/colormaps_reference.html

Thanks but this only shows how to use it once you have it. When I run
this code I get an error message telling it can't find any of those
new colormaps.

/Martin

Albert-Jan Roskam

unread,
Jan 23, 2017, 3:36:09 PM1/23/17
to
(sorry for top-posting)
I does not appear to be possible in matplolibrc (1). But you can use matplotlib.cm.register_cmap to register new cmaps (2) such as these (3).

(Note: I did not try this)

(1)http://matplotlib.org/1.4.0/users/customizing.html
(2)http://matplotlib.org/api/cm_api.html
(3)https://github.com/BIDS/colormap/blob/master/colormaps.py
________________________________
From: Python-list <python-list-bounces+sjeik_appie=hotma...@python.org> on behalf of Martin Schöön <martin...@gmail.com>
Sent: Saturday, January 21, 2017 8:42:29 PM
To: pytho...@python.org
Subject: Re: Adding colormaps?
--
https://mail.python.org/mailman/listinfo/python-list

Martin Schöön

unread,
Feb 11, 2018, 4:19:50 PM2/11/18
to
Den 2017-01-23 skrev Albert-Jan Roskam <sjeik...@hotmail.com>:
> (sorry for top-posting)
> I does not appear to be possible in matplolibrc (1). But you can
> use matplotlib.cm.register_cmap to register new cmaps (2) such
> as these (3).
>
> (Note: I did not try this)
>
> (1)http://matplotlib.org/1.4.0/users/customizing.html
> (2)http://matplotlib.org/api/cm_api.html
> (3)https://github.com/BIDS/colormap/blob/master/colormaps.py

More than a year later I think I can advice on the best workaround:
Use virtualenv and you can work with newer versions of Python packages
than those available in your Linux distro of base Python installation.

I am currently learning to use jupyter notebook, pandas and other
nice packages in much more recent versions than available in my Linux
distro.

I hope I can copy this onto my computer at work -- running another Linux
distro where virtualenv3 does not seem to be available.

/Martin

Martin Schöön

unread,
Feb 12, 2018, 7:15:50 PM2/12/18
to
0 new messages