Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
beat
beat.examples
Commits
ccbe0cb1
Commit
ccbe0cb1
authored
9 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Patches
Plain Diff
Colors for several plots, corrected
parent
0c8f9402
No related branches found
No related tags found
1 merge request
!9
Colors for several plots, corrected
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
system/plotters/plot_username/bar/1.py
+1
-0
1 addition, 0 deletions
system/plotters/plot_username/bar/1.py
system/plotters/plot_username/isoroc/1.py
+22
-21
22 additions, 21 deletions
system/plotters/plot_username/isoroc/1.py
with
23 additions
and
21 deletions
system/plotters/plot_username/bar/1.py
+
1
−
0
View file @
ccbe0cb1
...
...
@@ -82,6 +82,7 @@ class Plotter(baselib.Plotter):
args
=
[]
label
=
[]
kwargs
=
[]
single_experiment
=
len
(
inputs
)
==
1
...
...
This diff is collapsed.
Click to expand it.
system/plotters/plot_username/isoroc/1.py
+
22
−
21
View file @
ccbe0cb1
...
...
@@ -56,11 +56,11 @@ class Plotter(baselib.Plotter):
self
.
ylabel
=
"
False Negatives (False Non-Match Rate), in %
"
# These are the "Tableau 20" colors as RGB.
self
.
tableau20
=
[(
31
.
119
.
180
),
(
152
.
223
.
138
),
(
140
.
86
.
75
),
(
199
.
199
.
199
),
(
174
.
199
.
232
),
(
214
.
39
.
40
),
(
196
.
156
.
148
),
(
188
.
189
.
34
),
(
255
.
127
.
14
),
(
255
.
152
.
150
),
(
227
.
119
.
194
),
(
219
.
219
.
141
),
(
255
.
187
.
120
),
(
148
.
103
.
189
),
(
247
.
182
.
210
),
(
23
.
190
.
207
),
(
44
.
160
.
44
),
(
197
.
176
.
213
),
(
127
.
127
.
127
),
(
158
.
218
.
229
)]
self
.
tableau20
=
[(
31
,
119
,
180
),
(
152
,
223
,
138
),
(
140
,
86
,
75
),
(
199
,
199
,
199
),
(
174
,
199
,
232
),
(
214
,
39
,
40
),
(
196
,
156
,
148
),
(
188
,
189
,
34
),
(
255
,
127
,
14
),
(
255
,
152
,
150
),
(
227
,
119
,
194
),
(
219
,
219
,
141
),
(
255
,
187
,
120
),
(
148
,
103
,
189
),
(
247
,
182
,
210
),
(
23
,
190
,
207
),
(
44
,
160
,
44
),
(
197
,
176
,
213
),
(
127
,
127
,
127
),
(
158
,
218
,
229
)]
# Scale the RGB values to the [0, 1] range, which is the format matplotlib accepts.
for
i
in
range
(
len
(
self
.
tableau20
)):
r
,
g
,
b
=
self
.
tableau20
[
i
]
...
...
@@ -71,7 +71,6 @@ class Plotter(baselib.Plotter):
def
process
(
self
,
inputs
):
fig
,
ax
=
super
(
Plotter
,
self
).
prepare_canvas
()
super
(
Plotter
,
self
).
apply_parameters
(
ax
)
...
...
@@ -83,17 +82,17 @@ class Plotter(baselib.Plotter):
ax
.
set_xlim
((
self
.
xlim_left
,
self
.
xlim_right
))
ax
.
set_ylim
((
self
.
ylim_bottom
,
self
.
ylim_top
))
args
=
[]
label
=
[]
label
=
""
kwargs
=
{}
single_experiment
=
len
(
inputs
)
==
1
number_of_positives
=
[]
number_of_negatives
=
[]
n_lines
=
0
for
xp_label
,
xp_data
in
inputs
:
for
scatter
in
xp_data
.
data
:
args
=
[]
# the data
x
=
scatter
.
false_positives
if
self
.
det
:
...
...
@@ -110,25 +109,27 @@ class Plotter(baselib.Plotter):
# the label
if
self
.
label
:
#gets the label from user overwritten input
label
.
append
(
self
.
label
[
len
(
label
)
%
len
(
self
.
label
)]
)
label
=
self
.
label
[
n_lines
%
len
(
self
.
label
)]
else
:
#make-up label
if
single_experiment
:
label
.
append
(
scatter
.
label
)
label
=
scatter
.
label
else
:
text
=
[
k
for
k
in
(
xp_label
,
scatter
.
label
)
if
k
]
label
.
append
(
'
-
'
.
join
(
text
)
)
label
=
'
-
'
.
join
(
text
)
# the line attributes
if
self
.
line_attributes
:
args
.
append
(
self
.
line_attributes
[
len
(
label
)
%
len
(
self
.
line_attributes
)])
args
.
append
(
self
.
line_attributes
[
n_lines
%
len
(
self
.
line_attributes
)])
else
:
args
.
append
(
'
color
'
)
args
.
append
(
self
.
tableau20
[
len
(
label
)
%
len
(
self
.
tableau20
)])
kwargs
[
'
color
'
]
=
self
.
tableau20
[
n_lines
%
len
(
self
.
tableau20
)]
lines
=
ax
.
plot
(
*
args
)
if
len
(
lines
)
>
1
:
ax
.
legend
(
lines
,
label
,
loc
=
self
.
loc
,
fontsize
=
self
.
legend_fontsize
,
fancybox
=
True
,
framealpha
=
0.75
)
kwargs
[
'
label
'
]
=
label
n_lines
+=
1
ax
.
plot
(
*
args
,
**
kwargs
)
if
n_lines
>
1
:
ax
.
legend
(
loc
=
self
.
loc
,
fontsize
=
self
.
legend_fontsize
,
fancybox
=
True
,
framealpha
=
0.5
)
# reset log axis
...
...
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