From: Eric F. <ef...@ha...> - 2010-01-27 19:32:04
|
Jae-Joon Lee wrote: > On Mon, Jan 25, 2010 at 7:19 PM, Jae-Joon Lee <lee...@gm...> wrote: >> Adding a "set_ticks" method seems reasonable. > > A patch is attached. It looks like exactly what I had in mind with respect to set_ticks. I wasn't thinking about set_ticklabels; my sense is that manually setting ticklabels tends to be tricky and error-prone, and should be discouraged. Maybe it should be permitted only when a FixedLocator is already in use. > It does some refactoring and introduces three new methods, set_ticks, > set_ticklabels and update_ticks, on the colorbar class. > So, now one can do > > imshow(np.arange(100).reshape((10,10))) > cb = colorbar() > cb.set_ticks([0, 40, 80]) > > Issuing a warning when user try to call Axis.set_ticks (or others) > directly seems not straight forward as the axes can be created > externally (i.e., when *cax* is provided). Attached patch against svn (without your patch) shows how this can be done for the Axes methods. I would be more difficult (but not impossible) for the Axis methods, because we need to use them. I think that handling the Axes methods *may* be worthwhile (marginal), but handling the Axis methods is more trouble than it is worth. Eric > > I'll wait for response for a few more days and will commit the change. > Regards, > > -JJ |