more convenience methods for color maps and bars#2090
Merged
j9ac9k merged 9 commits intopyqtgraph:masterfrom Nov 18, 2021
Merged
more convenience methods for color maps and bars#2090j9ac9k merged 9 commits intopyqtgraph:masterfrom
j9ac9k merged 9 commits intopyqtgraph:masterfrom
Conversation
Member
|
That cyclic import is going to be tough to work-around, unless you move the import of |
j9ac9k
reviewed
Nov 15, 2021
pyqtgraph/graphicsItems/ImageItem.py
Outdated
| """ | ||
| return self._colorMap | ||
|
|
||
| # def addColorBar(self, colorMap=None, plot=None, **kargs): |
Member
There was a problem hiding this comment.
Looks like just need to delete this commented out code and this is probably good to merge? I should take this diff for a spin myself first I suppose.
Member
|
Thanks for all the documentation tidying! This LGTM, merging. |
ntjess
pushed a commit
to ntjess/pyqtgraph
that referenced
this pull request
Dec 10, 2021
* more convenience methods for color maps and bars * minor cleanup * return ColorBarItem when added * don't touch PlotItem * move addColorBar to PlotItem * wiggle initialization loops * documentation pass * add some more cross-references * removed an unused line from example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is meant to address #2067.
The
ImageItemfalse color options were initially completely designed around control throughHistogramLUTItem.This adds a
setColorMap()method to ImageItem, and the option to use this through acolorMapargument during initialization,setImage()orsetOpts().The PR also adds the option to create and add a
ColorBarItemthrough a newaddColorBar()method of ImageItem.This is somewhat inelegant, since the user needs to manually pass a reference to the plot. I could not find a means for the ImageItem to determine its parent. An alternative would have been to include
addColorBar()as a method of thePlotItem, but this results in a circular import.I have updated the ColorBarItem example to use the new methods for demonstration. The code to add an image with color map and interactive color bar is now down to just
Might close #2067 ...