Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Germain Clavier
python-tools
Commits
7eb79514
Commit
7eb79514
authored
Mar 17, 2022
by
Germain Clavier
Browse files
Options
Downloads
Patches
Plain Diff
qp can handle colors now and make new cycler!
parent
6d7935d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plot/qp
+29
-29
29 additions, 29 deletions
plot/qp
with
29 additions
and
29 deletions
plot/qp
+
29
−
29
View file @
7eb79514
...
...
@@ -212,8 +212,7 @@ def plot_sep_fil(data, fmt, is_log, legend, sy, hline, vline):
return
[
fig
,
axes
]
def
plot_data
(
data
,
colors
,
fmt
,
is_log
,
legend
,
names
,
sy
,
hline
,
vline
):
# color_iter = cycle(colors)
def
plot_data
(
data
,
fmt
,
is_log
,
legend
,
names
,
sy
,
hline
,
vline
):
plt
.
figure
(
figsize
=
(
40
,
30
))
namelist
=
iter
(
names
)
ax
=
plt
.
gca
()
...
...
@@ -321,8 +320,8 @@ def main():
type
=
float
,
default
=
1
,
help
=
'
scale for y
'
)
parser
.
add_argument
(
'
-nl
'
,
'
--no-legend
'
,
dest
=
'
no_legend
'
,
action
=
'
store_true
'
,
help
=
'
removes the legend
'
)
parser
.
add_argument
(
'
-
nGC
'
,
'
--
no-
colors
'
,
dest
=
'
noGC
'
,
action
=
'
store_true
'
,
help
=
'
no nice colors
'
)
parser
.
add_argument
(
'
-
c
'
,
'
--colors
'
,
dest
=
'
colors
'
,
nargs
=
'
*
'
,
help
=
'
A list of colors to use instead of default
'
)
parser
.
add_argument
(
'
-gr
'
,
'
--gradient
'
,
dest
=
'
grad
'
,
type
=
int
,
default
=
0
,
help
=
'
use n colors from aquatic gradient (thanks Florent)
'
)
...
...
@@ -364,13 +363,11 @@ def main():
is_log
=
(
0
,
0
)
sg
=
args
.
SG
grad
=
args
.
grad
if
args
.
names
:
names
=
args
.
names
[
0
]
else
:
names
=
[
''
]
legend
=
not
args
.
no_legend
noGC
=
args
.
noGC
if
not
inpt
:
sys
.
exit
(
'
No file provided as input source.
'
)
...
...
@@ -392,30 +389,33 @@ def main():
plt
.
style
.
use
(
'
Old
'
)
except
Exception
:
pass
# linestyle_list = ['-', '--', '-.', ':']
# color_list = ['#000000', '#888888', '#CCCCCC']
# color_list = ['#000000']
# marker_list = ['o', 's', 'v', '^']
# plt.rcParams['axes.prop_cycle'] = plt.cycler(color=color_list) * (plt.cycler(linestyle=linestyle_list) + plt.cycler(marker=marker_list))
regex_sk
=
re
.
compile
(
r
'
^\d+$
'
)
if
noGC
:
colors
=
[
'
black
'
,
'
darkred
'
,
'
red
'
,
'
orangered
'
,
'
darkorange
'
,
'
orange
'
,
'
olive
'
,
'
darkolivegreen
'
,
'
chartreuse
'
,
'
forestgreen
'
,
'
lightseagreen
'
,
'
lightskyblue
'
,
'
steelblue
'
,
'
blue
'
,
'
darkblue
'
,
'
indigo
'
]
elif
grad
:
colors
=
[]
mycolors
=
[
'
000000
'
,
'
888888
'
,
'
CCCCCC
'
]
mylinestyles
=
[
'
-
'
,
'
--
'
,
'
-.
'
,
'
:
'
]
mymarkers
=
[
'
o
'
,
'
s
'
,
'
v
'
,
'
^
'
]
make_new_cycler
=
False
if
args
.
colors
:
mycolors
=
args
.
colors
make_new_cycler
=
True
elif
args
.
grad
:
mycolors
=
[]
col1
=
np
.
array
([
2.
,
242.
,
245.
])
/
255.
col2
=
np
.
array
([
252.
,
44.
,
255.
])
/
255.
for
i
in
range
(
grad
):
x
=
i
/
(
grad
-
1
)
# c = g.extract(x)
# color = (c.r, c.g, c.b)
for
i
in
range
(
args
.
grad
):
x
=
i
/
(
args
.
grad
-
1
)
color
=
(
1
-
x
)
*
col1
+
x
*
col2
colors
.
append
(
color
)
else
:
colors
=
[
'
blue
'
,
'
red
'
,
'
green
'
]
# GCcolors.color_list
mycolors
.
append
(
color
)
make_new_cycler
=
True
if
make_new_cycler
:
mycycler
=
(
plt
.
cycler
(
color
=
mycolors
)
*
(
plt
.
cycler
(
linestyle
=
mylinestyles
)
+
plt
.
cycler
(
marker
=
mymarkers
)
)
)
plt
.
rcParams
[
'
axes.prop_cycle
'
]
=
mycycler
for
c
in
mycycler
:
print
(
c
)
columns_list
=
[]
data
=
[]
...
...
@@ -435,11 +435,11 @@ def main():
data
.
append
(
read_columns
(
fle
,
columns_list
,
fmt
,
skip
,
xsca
,
ysca
,
sg
))
if
sep_col
:
fig
,
axes
=
plot_sep_col
(
data
,
colors
,
fmt
,
is_log
,
legend
,
sy
,
hline
,
vline
)
fig
,
axes
=
plot_sep_col
(
data
,
fmt
,
is_log
,
legend
,
sy
,
hline
,
vline
)
elif
sep_files
:
fig
,
axes
=
plot_sep_fil
(
data
,
colors
,
fmt
,
is_log
,
legend
,
sy
,
hline
,
vline
)
fig
,
axes
=
plot_sep_fil
(
data
,
fmt
,
is_log
,
legend
,
sy
,
hline
,
vline
)
else
:
plot_data
(
data
,
colors
,
fmt
,
is_log
,
legend
,
names
,
sy
,
hline
,
vline
)
plot_data
(
data
,
fmt
,
is_log
,
legend
,
names
,
sy
,
hline
,
vline
)
plt
.
xlabel
(
xlab
)
plt
.
ylabel
(
ylab
)
...
...
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