Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uyegy
CPUnetPLOT
Commits
d88a4c23
Commit
d88a4c23
authored
Aug 28, 2014
by
Mario Hock
Browse files
Legend: Absolute offset also in area plots (CPU)
parent
672befef
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot_cpu.py
View file @
d88a4c23
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
from
collections
import
defaultdict
from
collections
import
defaultdict
from
operator
import
itemgetter
from
operator
import
itemgetter
from
matplotlib
import
transforms
import
numpy
import
numpy
import
copy
import
copy
...
@@ -108,7 +109,10 @@ def plot_area_chart(ax, cnl_file, cols, legend_outside=True, legend_title=None):
...
@@ -108,7 +109,10 @@ def plot_area_chart(ax, cnl_file, cols, legend_outside=True, legend_title=None):
# Legend
# Legend
if
(
legend_outside
):
if
(
legend_outside
):
l
=
ax
.
legend
(
bbox_to_anchor
=
(
1.2
,
1.02
),
fancybox
=
True
,
shadow
=
True
,
title
=
legend_title
)
offset
=
transforms
.
ScaledTranslation
(
20
,
0
,
transforms
.
IdentityTransform
())
trans
=
ax
.
transAxes
+
offset
l
=
ax
.
legend
(
loc
=
'upper left'
,
bbox_to_anchor
=
(
1.0
,
1.02
),
fancybox
=
True
,
shadow
=
True
,
title
=
legend_title
)
else
:
else
:
l
=
ax
.
legend
(
loc
=
0
)
l
=
ax
.
legend
(
loc
=
0
)
...
...
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