some questions about the ColorBarItem

319 views
Skip to first unread message

Michael Trumpis

unread,
Apr 15, 2021, 2:29:51 PM4/15/21
to pyqtgraph
Thanks for the great graphics library!

I've been trying to incorporate the new colorbar into my app, with partial success. The widget works in every way, except that the actual "color map" ImageItem shows up as a blank image (with possibly a compressed image at the bottom?)

colorbar.png

My ignorance about Qt can't be helping.. perhaps there's a problem with the way I'm setting up the panel where these items live. Within a GraphicsLayoutWidget, I do

1) addLayout to get a new panel
2) create ImageItem, layout.addPlot to get plot, add image to plot
3) create ColorBarItem, attach to ImageItem
4) layout.addItem for colorbar

Attached: I have successfully modified the colorbar demo to use the same steps (bottom left image). Just don't know why it's blank in my app.

Appreciate any insights..

cheers
Mike


ColorBarItem_sublayout.py

azpa...@gmail.com

unread,
Apr 16, 2021, 4:38:10 AM4/16/21
to pyqtgraph
Hello
I tried to run your example in my environment with pyqtgraph 0.12 and pyside2, but I actually don't have the ColorBarItem. The only colorbaritem I found online was part of pyqtgraph-extensions which I did not have installed. Can you tell me if you installed that separately ? 

Ognyan Moore

unread,
Apr 16, 2021, 10:19:02 AM4/16/21
to pyqt...@googlegroups.com
ColorBarItem was introduced in 0.12.1 but it is undocumented right now (we'll add documenting before too long I promise).

--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/f5d80afa-0f96-400e-a74f-ff0f84c7cf9en%40googlegroups.com.

Michael Trumpis

unread,
Apr 21, 2021, 3:58:55 PM4/21/21
to pyqtgraph
lol figured it out. I have my matrix orientation set to row-major, and ColorBarItem was not sensitive to that. Issue & PR now on github

Ognyan Moore

unread,
Apr 21, 2021, 5:05:44 PM4/21/21
to pyqt...@googlegroups.com
Hi Mike,

Saw your PR, thanks for submitting it!  I assigned the PR to the maintainer that created ColorBarItem; as I'm trying to get myself untangled from a PR I'm way too deep in myself right now.  If it sits idle for a few days, I'll review it.

Ogi

Reply all
Reply to author
Forward
0 new messages