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
92d3b3fb
Commit
92d3b3fb
authored
11 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
cleanups
parent
96296749
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/SimplePlot.py
+1
-7
1 addition, 7 deletions
examples/SimplePlot.py
pyqtgraph/graphicsItems/ArrowItem.py
+11
-12
11 additions, 12 deletions
pyqtgraph/graphicsItems/ArrowItem.py
with
12 additions
and
19 deletions
examples/SimplePlot.py
+
1
−
7
View file @
92d3b3fb
import
initExample
## Add path to library (just for examples; you do not need this)
import
initExample
## Add path to library (just for examples; you do not need this)
from
os.path
import
*
from
pyqtgraph.Qt
import
QtGui
,
QtCore
import
pyqtgraph
as
pg
import
pyqtgraph
as
pg
import
numpy
as
np
import
numpy
as
np
plt
=
pg
.
plot
(
np
.
random
.
normal
(
size
=
100
),
title
=
"
Simplest possible plotting example
"
)
plt
=
pg
.
plot
(
np
.
random
.
normal
(
size
=
100
),
title
=
"
Simplest possible plotting example
"
)
plt
.
getAxis
(
'
bottom
'
).
setTicks
([[(
x
*
20
,
str
(
x
*
20
))
for
x
in
range
(
6
)]])
## Start Qt event loop unless running in interactive mode or using pyside.
ex
=
pg
.
exporters
.
SVGExporter
.
SVGExporter
(
plt
.
plotItem
.
scene
())
ex
.
export
(
join
(
dirname
(
__file__
),
'
test.svg
'
))
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
import
sys
import
sys
if
sys
.
flags
.
interactive
!=
1
or
not
hasattr
(
QtCore
,
'
PYQT_VERSION
'
):
if
sys
.
flags
.
interactive
!=
1
or
not
hasattr
(
pg
.
QtCore
,
'
PYQT_VERSION
'
):
pg
.
QtGui
.
QApplication
.
exec_
()
pg
.
QtGui
.
QApplication
.
exec_
()
This diff is collapsed.
Click to expand it.
pyqtgraph/graphicsItems/ArrowItem.py
+
11
−
12
View file @
92d3b3fb
...
@@ -16,12 +16,14 @@ class ArrowItem(QtGui.QGraphicsPathItem):
...
@@ -16,12 +16,14 @@ class ArrowItem(QtGui.QGraphicsPathItem):
Arrows can be initialized with any keyword arguments accepted by
Arrows can be initialized with any keyword arguments accepted by
the setStyle() method.
the setStyle() method.
"""
"""
self
.
opts
=
{}
QtGui
.
QGraphicsPathItem
.
__init__
(
self
,
opts
.
get
(
'
parent
'
,
None
))
QtGui
.
QGraphicsPathItem
.
__init__
(
self
,
opts
.
get
(
'
parent
'
,
None
))
if
'
size
'
in
opts
:
if
'
size
'
in
opts
:
opts
[
'
headLen
'
]
=
opts
[
'
size
'
]
opts
[
'
headLen
'
]
=
opts
[
'
size
'
]
if
'
width
'
in
opts
:
if
'
width
'
in
opts
:
opts
[
'
headWidth
'
]
=
opts
[
'
width
'
]
opts
[
'
headWidth
'
]
=
opts
[
'
width
'
]
defOpts
=
{
def
ault
Opts
=
{
'
pxMode
'
:
True
,
'
pxMode
'
:
True
,
'
angle
'
:
-
150
,
## If the angle is 0, the arrow points left
'
angle
'
:
-
150
,
## If the angle is 0, the arrow points left
'
pos
'
:
(
0
,
0
),
'
pos
'
:
(
0
,
0
),
...
@@ -33,12 +35,9 @@ class ArrowItem(QtGui.QGraphicsPathItem):
...
@@ -33,12 +35,9 @@ class ArrowItem(QtGui.QGraphicsPathItem):
'
pen
'
:
(
200
,
200
,
200
),
'
pen
'
:
(
200
,
200
,
200
),
'
brush
'
:
(
50
,
50
,
200
),
'
brush
'
:
(
50
,
50
,
200
),
}
}
defOpts
.
update
(
opts
)
defaultOpts
.
update
(
opts
)
self
.
setStyle
(
**
defOpts
)
self
.
setPen
(
fn
.
mkPen
(
defOpts
[
'
pen
'
]))
self
.
setStyle
(
**
defaultOpts
)
self
.
setBrush
(
fn
.
mkBrush
(
defOpts
[
'
brush
'
]))
self
.
rotate
(
self
.
opts
[
'
angle
'
])
self
.
rotate
(
self
.
opts
[
'
angle
'
])
self
.
moveBy
(
*
self
.
opts
[
'
pos
'
])
self
.
moveBy
(
*
self
.
opts
[
'
pos
'
])
...
@@ -60,9 +59,9 @@ class ArrowItem(QtGui.QGraphicsPathItem):
...
@@ -60,9 +59,9 @@ class ArrowItem(QtGui.QGraphicsPathItem):
specified, ot overrides headWidth. default=25
specified, ot overrides headWidth. default=25
baseAngle Angle of the base of the arrow head. Default is
baseAngle Angle of the base of the arrow head. Default is
0, which means that the base of the arrow head
0, which means that the base of the arrow head
is perpendicular to the arrow
shaft
.
is perpendicular to the arrow
tail
.
tailLen Length of the arrow tail, measured from the base
tailLen Length of the arrow tail, measured from the base
of the arrow head to the
tip
of the tail. If
of the arrow head to the
end
of the tail. If
this value is None, no tail will be drawn.
this value is None, no tail will be drawn.
default=None
default=None
tailWidth Width of the tail. default=3
tailWidth Width of the tail. default=3
...
@@ -70,15 +69,15 @@ class ArrowItem(QtGui.QGraphicsPathItem):
...
@@ -70,15 +69,15 @@ class ArrowItem(QtGui.QGraphicsPathItem):
brush The brush used to fill the arrow.
brush The brush used to fill the arrow.
================= =================================================
================= =================================================
"""
"""
try
:
self
.
opts
.
update
(
opts
)
self
.
opts
.
update
(
opts
)
except
AttributeError
:
self
.
opts
=
opts
opt
=
dict
([(
k
,
self
.
opts
[
k
])
for
k
in
[
'
headLen
'
,
'
tipAngle
'
,
'
baseAngle
'
,
'
tailLen
'
,
'
tailWidth
'
]])
opt
=
dict
([(
k
,
self
.
opts
[
k
])
for
k
in
[
'
headLen
'
,
'
tipAngle
'
,
'
baseAngle
'
,
'
tailLen
'
,
'
tailWidth
'
]])
self
.
path
=
fn
.
makeArrowPath
(
**
opt
)
self
.
path
=
fn
.
makeArrowPath
(
**
opt
)
self
.
setPath
(
self
.
path
)
self
.
setPath
(
self
.
path
)
self
.
setPen
(
fn
.
mkPen
(
self
.
opts
[
'
pen
'
]))
self
.
setBrush
(
fn
.
mkBrush
(
self
.
opts
[
'
brush
'
]))
if
self
.
opts
[
'
pxMode
'
]:
if
self
.
opts
[
'
pxMode
'
]:
self
.
setFlags
(
self
.
flags
()
|
self
.
ItemIgnoresTransformations
)
self
.
setFlags
(
self
.
flags
()
|
self
.
ItemIgnoresTransformations
)
else
:
else
:
...
...
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