Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CPUnetPLOT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CPUnetLOG
CPUnetPLOT
Commits
b1840c15
Commit
b1840c15
authored
Dec 02, 2015
by
Mario Hock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set multiple colors
parent
114a6a8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
cnl_plot.py
cnl_plot.py
+11
-2
No files found.
cnl_plot.py
View file @
b1840c15
...
...
@@ -103,15 +103,23 @@ def get_min_max_x(cnl_file):
def
plot
(
ax
,
x_values
,
cols
,
active_cols
,
col_labels
,
alpha
,
color
=
None
,
**
kwargs
):
"""
[color] should be either None or a list,
if there are more lines to plot then colors in the list, the list is cycled-through (with modulo)
"""
#use_ema = kwargs.get("use_ema")
ema_only
=
kwargs
.
get
(
"ema_only"
)
smooth
=
kwargs
.
get
(
"smooth"
)
plot_kws
=
dict
()
if
(
color
):
plot_kws
[
"color"
]
=
color
i
=
0
for
col_name
,
col_label
in
zip
(
active_cols
,
col_labels
):
if
(
color
):
plot_kws
[
"color"
]
=
color
[
i
%
len
(
color
)]
data
=
cols
[
col_name
]
if
(
len
(
x_values
)
==
len
(
data
)
*
2
):
data
=
merge_lists
(
data
,
data
)
...
...
@@ -124,6 +132,7 @@ def plot(ax, x_values, cols, active_cols, col_labels, alpha, color=None, **kwarg
if
(
ema_only
and
smooth
):
ax
.
plot
(
x_values
,
calc_ema
(
data
,
smooth
),
label
=
col_label
,
**
plot_kws
)
i
+=
1
def
plot_net
(
ax
,
cnl_file
,
args
,
layout
):
# parameters
...
...
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