3D Widget Background

242 views
Skip to first unread message

Mathew Schwartz

unread,
Aug 4, 2015, 10:07:59 PM8/4/15
to pyqtgraph
I saw a post from over a year ago about background color of the 3d widget.  How can I change it to white, either as a method or through the source, as I just need to make some figures like that.

Thanks

Luke Campagnola

unread,
Aug 8, 2015, 11:47:19 AM8/8/15
to pyqt...@googlegroups.com

On Tue, Aug 4, 2015 at 10:07 PM, Mathew Schwartz <umc...@gmail.com> wrote:
I saw a post from over a year ago about background color of the 3d widget.  How can I change it to white, either as a method or through the source, as I just need to make some figures like that.

Thanks

--
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/95d54f89-165b-4f67-9107-dd0d39ffb99d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeremy Laforet

unread,
Apr 25, 2016, 8:28:53 AM4/25/16
to pyqtgraph
I'm trying to use this function to get a grey background on my plots, so far with no success…

If called with a single letter input ("k", "w", "c"…) setBackgroundColor will  behave as expected, and my plot will have a black, white or cyan… background, but not for "d", "l" or "s".
But if called with anything else it will produce a white background for all color specifications but black, in that case the background is indeed black.

print(w.opts['bgcolor'].getRgb()) will give back the expected RGBA value, even if the displayed background is plain white instead.

I've tried on both OSX and Linux with the same behavior.

Is there any way to get a grey background on a GlView ?

Edmon Silva

unread,
Dec 28, 2016, 5:31:53 AM12/28/16
to pyqtgraph
Have you found any solution for that?

I'm struggling to set custom RGB values for the background color of pyqtgraph.opengl.GLViewWidget. Would someone provide a working example?

Edmon Silva

unread,
Dec 29, 2016, 3:03:30 AM12/29/16
to pyqtgraph
I found how to do that. For anyone would like to know that, here it is:

There is a small bug in paintGL function in GLViewWidget.py. All you have to do is replacing 
glClearColor(bgcolor.red(), bgcolor.green(), bgcolor.blue(), 1.0)
with
glClearColor(bgcolor.redF(), bgcolor.greenF(), bgcolor.blueF(), 1.0)

Hope that helps!
Reply all
Reply to author
Forward
0 new messages