Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
00a885f7
Commit
00a885f7
authored
12 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
minor bugfixes for scatterplotitem
parent
d0e5caac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
graphicsItems/ScatterPlotItem.py
+11
-9
11 additions, 9 deletions
graphicsItems/ScatterPlotItem.py
with
11 additions
and
9 deletions
graphicsItems/ScatterPlotItem.py
+
11
−
9
View file @
00a885f7
...
...
@@ -35,7 +35,7 @@ for k, c in coords.items():
def
makeSymbolPixmap
(
size
,
pen
,
brush
,
symbol
):
## Render a spot with the given parameters to a pixmap
penPxWidth
=
np
.
ceil
(
pen
.
width
())
penPxWidth
=
max
(
np
.
ceil
(
pen
.
width
())
,
1
)
image
=
QtGui
.
QImage
(
size
+
penPxWidth
,
size
+
penPxWidth
,
QtGui
.
QImage
.
Format_ARGB32_Premultiplied
)
image
.
fill
(
0
)
p
=
QtGui
.
QPainter
(
image
)
...
...
@@ -78,7 +78,7 @@ class ScatterPlotItem(GraphicsObject):
"""
prof
=
debug
.
Profiler
(
'
ScatterPlotItem.__init__
'
,
disabled
=
True
)
GraphicsObject
.
__init__
(
self
)
self
.
setFlag
(
self
.
ItemHasNoContents
,
True
)
#
self.setFlag(self.ItemHasNoContents, True)
self
.
data
=
np
.
empty
(
0
,
dtype
=
[(
'
x
'
,
float
),
(
'
y
'
,
float
),
(
'
size
'
,
float
),
(
'
symbol
'
,
'
S1
'
),
(
'
pen
'
,
object
),
(
'
brush
'
,
object
),
(
'
item
'
,
object
),
(
'
data
'
,
object
)])
self
.
bounds
=
[
None
,
None
]
## caches data bounds
self
.
_maxSpotWidth
=
0
## maximum size of the scale-variant portion of all spots
...
...
@@ -355,17 +355,18 @@ class ScatterPlotItem(GraphicsObject):
## keep track of the maximum spot size and pixel size
width
=
0
pxWidth
=
0
if
self
.
opts
[
'
pxMode
'
]:
pxWidth
+=
spot
.
size
()
else
:
width
+=
spot
.
size
()
pen
=
spot
.
pen
()
if
pen
.
isCosmetic
()
:
pxWidth
+
=
pen
.
width
()
*
2
if
self
.
opts
[
'
pxMode
'
]
:
pxWidth
=
spot
.
size
()
+
pen
.
width
()
else
:
width
+=
pen
.
width
()
*
2
width
=
spot
.
size
()
if
pen
.
isCosmetic
():
pxWidth
+=
pen
.
width
()
else
:
width
+=
pen
.
width
()
self
.
_maxSpotWidth
=
max
(
self
.
_maxSpotWidth
,
width
)
self
.
_maxSpotPxWidth
=
max
(
self
.
_maxSpotPxWidth
,
pxWidth
)
self
.
bounds
=
[
None
,
None
]
def
clear
(
self
):
...
...
@@ -388,6 +389,7 @@ class ScatterPlotItem(GraphicsObject):
if
frac
>=
1.0
and
self
.
bounds
[
ax
]
is
not
None
:
return
self
.
bounds
[
ax
]
self
.
prepareGeometryChange
()
if
self
.
data
is
None
or
len
(
self
.
data
)
==
0
:
return
(
None
,
None
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment