Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
42553854
Commit
42553854
authored
Aug 23, 2013
by
Luke Campagnola
Browse files
pg.plot() and pg.PlotWidget() now accept background argument
ImageExporter correctly handles QBrush with style=NoBrush
parent
824e4b37
Changes
3
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/__init__.py
View file @
42553854
...
...
@@ -281,7 +281,7 @@ def plot(*args, **kargs):
#if len(args)+len(kargs) > 0:
#w.plot(*args, **kargs)
pwArgList
=
[
'title'
,
'labels'
,
'name'
,
'left'
,
'right'
,
'top'
,
'bottom'
]
pwArgList
=
[
'title'
,
'labels'
,
'name'
,
'left'
,
'right'
,
'top'
,
'bottom'
,
'background'
]
pwArgs
=
{}
dataArgs
=
{}
for
k
in
kargs
:
...
...
pyqtgraph/exporters/ImageExporter.py
View file @
42553854
...
...
@@ -17,7 +17,11 @@ class ImageExporter(Exporter):
scene
=
item
.
scene
()
else
:
scene
=
item
bg
=
scene
.
views
()[
0
].
backgroundBrush
().
color
()
bgbrush
=
scene
.
views
()[
0
].
backgroundBrush
()
bg
=
bgbrush
.
color
()
if
bgbrush
.
style
()
==
QtCore
.
Qt
.
NoBrush
:
bg
.
setAlpha
(
0
)
self
.
params
=
Parameter
(
name
=
'params'
,
type
=
'group'
,
children
=
[
{
'name'
:
'width'
,
'type'
:
'int'
,
'value'
:
tr
.
width
(),
'limits'
:
(
0
,
None
)},
{
'name'
:
'height'
,
'type'
:
'int'
,
'value'
:
tr
.
height
(),
'limits'
:
(
0
,
None
)},
...
...
pyqtgraph/widgets/PlotWidget.py
View file @
42553854
...
...
@@ -40,10 +40,12 @@ class PlotWidget(GraphicsView):
For all
other methods, use :func:`getPlotItem <pyqtgraph.PlotWidget.getPlotItem>`.
"""
def
__init__
(
self
,
parent
=
None
,
**
kargs
):
"""When initializing PlotWidget, all keyword arguments except *parent* are passed
def
__init__
(
self
,
parent
=
None
,
background
=
'default'
,
**
kargs
):
"""When initializing PlotWidget, *parent* and *background* are passed to
:func:`GraphicsWidget.__init__() <pyqtgraph.GraphicsWidget.__init__>`
and all others are passed
to :func:`PlotItem.__init__() <pyqtgraph.PlotItem.__init__>`."""
GraphicsView
.
__init__
(
self
,
parent
)
GraphicsView
.
__init__
(
self
,
parent
,
background
=
background
)
self
.
setSizePolicy
(
QtGui
.
QSizePolicy
.
Expanding
,
QtGui
.
QSizePolicy
.
Expanding
)
self
.
enableMouse
(
False
)
self
.
plotItem
=
PlotItem
(
**
kargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment