clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

add ClawPlotItem.colorbar_kwargs #227

Closed rjleveque closed 6 years ago

rjleveque commented 6 years ago

useful e.g. for adding arrows to colorbar when colors saturate, e.g. plotitem.colorbar_kwargs = {'extend': 'both'}

mandli commented 6 years ago

I at some point did the same thing but only locally. Maybe we should also just add the other too the dict as well?

rjleveque commented 6 years ago

You mean add things like colorbar_shrink? We could eliminate such things, but for backward compatibility I think we can leave them as attributes and the user could set them either explicitly or as part of colorbar_kwargs.

mandli commented 6 years ago

Agree with the maintaining of backwards compatibility but I was also thinking that someone could (rightly) assume that adding those keys to this dictionary should work but that would lead to a confusing double argument error. I think we could do something where those attributes are maintained but colorbar_kwargs could be updated with their values in case they are set that way as well and then remove the explicit code from the actual call.

rjleveque commented 6 years ago

@mandli, is this ok now?