x = [x for x in range(1000)]
y = [x for x in range(1000)]
plotWidget = pg.PlotWidget(title="Ph")
plotWidget.setBackground((0, 0, 0, 0))
plotWidget.getViewBox().setBackgroundColor((0, 0, 0, 0))
self._tab_layout.addWidget(plotWidget, 0, 0)
pen = pg.mkPen(color=(255, 0, 0))
t = plotWidget.plot(x, y, pen=pen)
t.getViewBox().setBackgroundColor((0, 0, 0, 0))
So it looks like this, and I would:
And I would like to have it drawn on this background instead:
Any idea how to fix this?Thanks!
On Apr 11, 2020, at 8:11 AM, Daniele Dolci <daniele...@gmail.com> wrote:
Hi!I have a main widget with a layout and a gradient as background. I want to add a series of plots with transperent background (basically I would like to only draw the foreground). I am having hardtimes making the background of the plot transperent. I tried lot of things, with this code I was expecting that I would be making all transparent, but it is actually white:
x = [x for x in range(1000)]
y = [x for x in range(1000)]
plotWidget = pg.PlotWidget(title="Ph")
plotWidget.setBackground((0, 0, 0, 0))
plotWidget.getViewBox().setBackgroundColor((0, 0, 0, 0))
self._tab_layout.addWidget(plotWidget, 0, 0)
pen = pg.mkPen(color=(255, 0, 0))
t = plotWidget.plot(x, y, pen=pen)
t.getViewBox().setBackgroundColor((0, 0, 0, 0))
So it looks like this, and I would:
<plot1.jpg>
And I would like to have it drawn on this background instead:
<plot2.jpg>
Any idea how to fix this?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/2e9b649e-dc5e-4a92-ad3f-b6b9cfb6226d%40googlegroups.com.
<plot1.jpg><plot2.jpg>
Try:plotWidget.setBackgroundBrush(QBrush(Qt.transparent, Qt.NoBrush))
To unsubscribe from this group and stop receiving emails from it, send an email to pyqt...@googlegroups.com.
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/3c60ca81-99f3-4c4c-9a4e-7cd22d7f9335%40googlegroups.com.
x = [x for x in range(1000)]
y = [x for x in range(1000)]
plotWidget = pg.PlotWidget(title="Ph")
plotWidget.setBackgroundBrush(QtGui.QBrush(QtCore.Qt.transparent, QtCore.Qt.NoBrush))
self._tab_layout.addWidget(plotWidget, 0, 0)
t = plotWidget.plot(x, y)
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/3c60ca81-99f3-4c4c-9a4e-7cd22d7f9335%40googlegroups.com.
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/4c71a8d2-5d8c-41a7-a3d2-e5a9dc106117%40googlegroups.com.
sudo apt install python3-pyqtgraphTo view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/4c71a8d2-5d8c-41a7-a3d2-e5a9dc106117%40googlegroups.com.
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/4d6a1fdc-0df4-435e-a362-1e5b8e0328fb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/4d6a1fdc-0df4-435e-a362-1e5b8e0328fb%40googlegroups.com.
sudo pip3 uninstall pyqtgraph 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/770c9bdc-6fd4-46bc-a1fd-64e212790413%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/2FCF8E91-6628-4A0B-83B3-0B24F22CB62D%40alaska.edu.

To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAF_JKbCxJK1NUrcrJnJ0m8eLfAHGt11POh5knCPmLwL3--d%3D3A%40mail.gmail.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/770c9bdc-6fd4-46bc-a1fd-64e212790413%40googlegroups.com.
--
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 pyqt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/2FCF8E91-6628-4A0B-83B3-0B24F22CB62D%40alaska.edu.
--Daniele DolciTechnical Director & Python DeveloperVetralla, ItalySkype: dolci.danielePortfolio (YouTube): https://youtu.be/IMZdW4ikjok=======================================Insanity: doing the same thing over and over again and expecting different results.- Albert Einstein ---
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 pyqt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CAF_JKbCxJK1NUrcrJnJ0m8eLfAHGt11POh5knCPmLwL3--d%3D3A%40mail.gmail.com.
On Apr 12, 2020, at 11:35 AM, Daniele Dolci <daniele...@gmail.com> wrote:
Hi! It was actually easier than I expected. A couple of css line did the trick. Just set the objectName of the plot widget and then I could assign a background-color: rgba(x, x, x, 0);
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/a97a376c-c8e9-403d-9cb5-b733fb773594%40googlegroups.com.
<plots.jpg>