Hi, I just created a hsv-like color map with gray levels only, now I'd like to use this as default color map. But how? Calling it like hsv() does not work and I did not find a hint in the documentation how to set a user defined color map interactively as default color map. Cheers Philipp -- View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24587528.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Does no one have an idea? If not, this is a severe usability bug! Philipp Lies wrote: > > Hi, > > I just created a hsv-like color map with gray levels only, now I'd like to > use this as default color map. But how? Calling it like hsv() does not > work and I did not find a hint in the documentation how to set a user > defined color map interactively as default color map. > > Cheers > > Philipp > -- View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24733739.html Sent from the matplotlib - users mailing list archive at Nabble.com.
I don't think there is any user-visible support for registering a custom colormap. However, it seems to me that adding the colormap to matplotlib.cm.datad distionary is enough. Note that the value need to be a dictionary of RGB specification, not the actual colormap instance. for example, mycolormap = {'blue': ((0.0, 0.40000000000000002, 0.40000000000000002), (1.0, 0.40000000000000002, 0.40000000000000002)), 'green': ((0.0, 0.5, 0.5), (1.0, 1.0, 1.0)), 'red': ((0.0, 0.0, 0.0), (1.0, 1.0, 1.0))} matplotlib.cm.datad["mycolormap"] = mycolormap rcParams["image.cmap"]="mycolormap" Having a function (like jet in pylab) would not be also difficult. Take a look at the definition of "jet" function (for example) in the pylab.py. We may be better to have a proper way to register a custom colormap. I'll try to take a more look later, but any patch will be appreciated. Regards, -JJ On Thu, Jul 30, 2009 at 3:48 AM, Philipp Lies<phi...@go...> wrote: > > Does no one have an idea? If not, this is a severe usability bug! > > Philipp Lies wrote: >> >> Hi, >> >> I just created a hsv-like color map with gray levels only, now I'd like to >> use this as default color map. But how? Calling it like hsv() does not >> work and I did not find a hint in the documentation how to set a user >> defined color map interactively as default color map. >> >> Cheers >> >> Philipp >> > > -- > View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24733739.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Jae-Joon Lee wrote: > I don't think there is any user-visible support for registering a > custom colormap. I have it almost done; I will commit it shortly. Eric > However, it seems to me that adding the colormap to > matplotlib.cm.datad distionary is enough. > Note that the value need to be a dictionary of RGB specification, not > the actual colormap instance. (I will have a more general solution than this.) > > for example, > > mycolormap = {'blue': ((0.0, 0.40000000000000002, 0.40000000000000002), > (1.0, 0.40000000000000002, 0.40000000000000002)), > 'green': ((0.0, 0.5, 0.5), (1.0, 1.0, 1.0)), > 'red': ((0.0, 0.0, 0.0), (1.0, 1.0, 1.0))} > > matplotlib.cm.datad["mycolormap"] = mycolormap > rcParams["image.cmap"]="mycolormap" > > Having a function (like jet in pylab) would not be also difficult. > Take a look at the definition of "jet" function (for example) in the > pylab.py. > > We may be better to have a proper way to register a custom colormap. > I'll try to take a more look later, but any patch will be appreciated. > > Regards, > > -JJ > > > > On Thu, Jul 30, 2009 at 3:48 AM, Philipp > Lies<phi...@go...> wrote: >> Does no one have an idea? If not, this is a severe usability bug! >> >> Philipp Lies wrote: >>> Hi, >>> >>> I just created a hsv-like color map with gray levels only, now I'd like to >>> use this as default color map. But how? Calling it like hsv() does not >>> work and I did not find a hint in the documentation how to set a user >>> defined color map interactively as default color map. >>> >>> Cheers >>> >>> Philipp >>> >> -- >> View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24733739.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jae-Joon Lee wrote: > I don't think there is any user-visible support for registering a > custom colormap. Now there is: svn r7309. Its use is illustrated via a modification of examples/pylab_examples/custom_cmap.py. With just a little more work, we could make it so that anything taking a "cmap" kwarg will accept either a Colormap instance or the name of a registered instance (including builtins). Maybe I will do that later today. Eric > However, it seems to me that adding the colormap to > matplotlib.cm.datad distionary is enough. > Note that the value need to be a dictionary of RGB specification, not > the actual colormap instance. > > for example, > > mycolormap = {'blue': ((0.0, 0.40000000000000002, 0.40000000000000002), > (1.0, 0.40000000000000002, 0.40000000000000002)), > 'green': ((0.0, 0.5, 0.5), (1.0, 1.0, 1.0)), > 'red': ((0.0, 0.0, 0.0), (1.0, 1.0, 1.0))} > > matplotlib.cm.datad["mycolormap"] = mycolormap > rcParams["image.cmap"]="mycolormap" > > Having a function (like jet in pylab) would not be also difficult. > Take a look at the definition of "jet" function (for example) in the > pylab.py. > > We may be better to have a proper way to register a custom colormap. > I'll try to take a more look later, but any patch will be appreciated. > > Regards, > > -JJ > > > > On Thu, Jul 30, 2009 at 3:48 AM, Philipp > Lies<phi...@go...> wrote: >> Does no one have an idea? If not, this is a severe usability bug! >> >> Philipp Lies wrote: >>> Hi, >>> >>> I just created a hsv-like color map with gray levels only, now I'd like to >>> use this as default color map. But how? Calling it like hsv() does not >>> work and I did not find a hint in the documentation how to set a user >>> defined color map interactively as default color map. >>> >>> Cheers >>> >>> Philipp >>> >> -- >> View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24733739.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On 2009年7月30日 09:41:43 -1000 Eric Firing <ef...@ha...> wrote: > Jae-Joon Lee wrote: > > I don't think there is any user-visible support for registering a > > custom colormap. > > Now there is: svn r7309. Its use is illustrated via a modification of > examples/pylab_examples/custom_cmap.py. Awesome, works just as I need it! Keep up the good work! Now I'm one step closer to abandoning matlab :-D Philipp > > With just a little more work, we could make it so that anything taking a > "cmap" kwarg will accept either a Colormap instance or the name of a > registered instance (including builtins). Maybe I will do that later today. > > Eric > > > > However, it seems to me that adding the colormap to > > matplotlib.cm.datad distionary is enough. > > Note that the value need to be a dictionary of RGB specification, not > > the actual colormap instance. > > > > for example, > > > > mycolormap = {'blue': ((0.0, 0.40000000000000002, 0.40000000000000002), > > (1.0, 0.40000000000000002, 0.40000000000000002)), > > 'green': ((0.0, 0.5, 0.5), (1.0, 1.0, 1.0)), > > 'red': ((0.0, 0.0, 0.0), (1.0, 1.0, 1.0))} > > > > matplotlib.cm.datad["mycolormap"] = mycolormap > > rcParams["image.cmap"]="mycolormap" > > > > Having a function (like jet in pylab) would not be also difficult. > > Take a look at the definition of "jet" function (for example) in the > > pylab.py. > > > > We may be better to have a proper way to register a custom colormap. > > I'll try to take a more look later, but any patch will be appreciated. > > > > Regards, > > > > -JJ > > > > > > > > On Thu, Jul 30, 2009 at 3:48 AM, Philipp > > Lies<phi...@go...> wrote: > >> Does no one have an idea? If not, this is a severe usability bug! > >> > >> Philipp Lies wrote: > >>> Hi, > >>> > >>> I just created a hsv-like color map with gray levels only, now I'd like to > >>> use this as default color map. But how? Calling it like hsv() does not > >>> work and I did not find a hint in the documentation how to set a user > >>> defined color map interactively as default color map. > >>> > >>> Cheers > >>> > >>> Philipp > >>> > >> -- > >> View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24733739.html > >> Sent from the matplotlib - users mailing list archive at Nabble.com. > >> > >> > >> ------------------------------------------------------------------------------ > >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > >> trial. Simplify your report design, integration and deployment - and focus on > >> what you do best, core application coding. Discover what's new with > >> Crystal Reports now. http://p.sf.net/sfu/bobj-july > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li... > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Philipp Lies Max Planck Institute for Biological Cybernetics Computational Vision & Neuroscience Group Spemannstr. 41 D-72076 Tuebingen Germany Phone: +49-7071-601-1788 Fax: +49-7071-601-552 E-Mail: phi...@tu... http://www.kyb.mpg.de/bethgegroup