[Matplotlib-users] default cmap in ver. 2.0

Weining Duan wn.duan at gmail.com
Fri Jan 20 08:04:44 EST 2017


Hi,

I’ve read your talk and decided to make some test case on my computer. Just expecting to offer some more test case and information.

As for now, I find everything works fine, including the colormap for `imshow()` function. I’ve checked the rc file, that line is commented out. So its really weird of Jon's situation.

I’m using anaconda + matplotlib 2.0 on MacOS.

Weining Duan

On 2017年1月20日 +0800 06:21, Benjamin Root <ben.v.root at gmail.com>, wrote:
> well, that would be matplotlib.defaultParams. It is hard-coded. It serves as the base config, and the rc file simply updates that dictionary. Your situation seems very weird. Can you confirm that rc['image.cmap'] is 'viridis'?
>
> Ben Root
>
> > On Thu, Jan 19, 2017 at 4:47 PM, Slavin, Jonathan <jslavin at cfa.harvard.edu> wrote:
> > > It's showing ~/.config/matplotlib/matplotlibrc  But as I said, the line with image.cmap on it was commented out.  So how are the defaults set for things that are not changed by the matplotlibrc?
> > >
> > > Jon
> > >
> > > > On Thu, Jan 19, 2017 at 4:32 PM, Benjamin Root <ben.v.root at gmail.com> wrote:
> > > > > Ok, then try this to find out what config file is being used:
> > > > >
> > > > > import matplotlib
> > > > > print(matplotlib.matplotlib_fname())
> > > > >
> > > > > Ben Root
> > > > >
> > > > >
> > > > > > On Thu, Jan 19, 2017 at 4:19 PM, Slavin, Jonathan <jslavin at cfa.harvard.edu> wrote:
> > > > > > > Hi Ben,
> > > > > > >
> > > > > > > It's definitely picking up the new matplotlib since many defaults for plotting, e.g. the line color cycle, tick direction, are changed.  It's really just the default colormap that's apparently unchanged.
> > > > > > >
> > > > > > > Jon
> > > > > > >
> > > > > > > > On Thu, Jan 19, 2017 at 4:09 PM, Benjamin Root <ben.v.root at gmail.com> wrote:
> > > > > > > > > in situations like this, the most common reason is that you aren't actually loading the matplotlib you think you are running. I would double-check by doing:
> > > > > > > > >
> > > > > > > > > import matplotlib
> > > > > > > > > print(matplotlib.__version__)
> > > > > > > > >
> > > > > > > > > Another trick I use is to type: "pydoc matplotlib" and see what it picked up.
> > > > > > > > >
> > > > > > > > > Ben Root
> > > > > > > > >
> > > > > > > > > > On Thu, Jan 19, 2017 at 4:05 PM, Slavin, Jonathan <jslavin at cfa.harvard.edu> wrote:
> > > > > > > > > > > Hi all,
> > > > > > > > > > >
> > > > > > > > > > > I just installed matplotlib 2.0.  I was surprised that when I created an image plot using imshow I had the same old jet colormap instead of viridis.  I looked in my ~/.confg/matplotlib/matplotlibrc file and the image.cmap line was commented out, so that didn't seem to be the problem.  Just to be sure, I moved that one aside and copied the new one under the matplotlib distribution to its place (which also has that line commented out).  I still get the same result.  Obviously I can fix this either by uncommenting that line or by specifying the cmap in calls to imshow.  But I'm curious, where are those defaults stored?
> > > > > > > > > > >
> > > > > > > > > > > Regards,
> > > > > > > > > > > Jon
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > ________________________________________________________
> > > > > > > > > > > Jonathan D. Slavin                 Harvard-Smithsonian CfA
> > > > > > > > > > > jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> > > > > > > > > > > phone: (617) 496-7981       Cambridge, MA 02138-1516
> > > > > > > > > > > cell: (781) 363-0035             USA
> > > > > > > > > > > ________________________________________________________
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > _______________________________________________
> > > > > > > > > > > Matplotlib-users mailing list
> > > > > > > > > > > Matplotlib-users at python.org
> > > > > > > > > > > https://mail.python.org/mailman/listinfo/matplotlib-users
> > > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > ________________________________________________________
> > > > > > > Jonathan D. Slavin                 Harvard-Smithsonian CfA
> > > > > > > jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> > > > > > > phone: (617) 496-7981       Cambridge, MA 02138-1516
> > > > > > > cell: (781) 363-0035             USA
> > > > > > > ________________________________________________________
> > > > > > >
> > > > >
> > >
> > >
> > >
> > > --
> > > ________________________________________________________
> > > Jonathan D. Slavin                 Harvard-Smithsonian CfA
> > > jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> > > phone: (617) 496-7981       Cambridge, MA 02138-1516
> > > cell: (781) 363-0035             USA
> > > ________________________________________________________
> > >
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170120/24bd51f6/attachment.html>


More information about the Matplotlib-users mailing list