Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plotter-nse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
数学の武士
plotter-nse
Commits
ba5a40d0
Commit
ba5a40d0
authored
1 year ago
by
数学の武士
Browse files
Options
Downloads
Patches
Plain Diff
Multiple figs by variables in file:
plot, ani_plot, multiple_plot
parent
16d9d896
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plotter/Plotter.py
+32
-20
32 additions, 20 deletions
plotter/Plotter.py
with
32 additions
and
20 deletions
plotter/Plotter.py
+
32
−
20
View file @
ba5a40d0
...
...
@@ -106,37 +106,49 @@ class Plotter:
os
.
system
(
"
mkdir -p
"
+
self
.
out
)
x_name
=
self
.
file_column_names
[
0
]
fig
=
plt
.
figure
()
if
self
.
oname
==
None
:
fig_names
=
self
.
var
fig_end
=
"
.png
"
else
:
fig_names
=
self
.
oname
fig_end
=
""
for
y_name
in
self
.
var
:
for
i
in
range
(
self
.
fig_count
):
y_name
=
self
.
var
[
i
]
fig
=
plt
.
figure
()
plt
.
plot
(
self
.
file_data
[
0
].
data
[
x_name
],
self
.
file_data
[
0
].
data
[
y_name
],
linewidth
=
4
)
plt
.
legend
(
self
.
var
)
plt
.
xlabel
(
x_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
plt
.
xlabel
(
y_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
if
self
.
if_manual_plot
:
plt
.
show
()
else
:
plt
.
close
(
fig
)
if
self
.
if_save_result
:
fig
.
savefig
(
self
.
out
+
self
.
oname
[
0
])
plt
.
xlabel
(
x_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
plt
.
ylabel
(
y_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
if
self
.
if_manual_plot
:
plt
.
show
()
else
:
plt
.
close
(
fig
)
if
self
.
if_save_result
:
fig
.
savefig
(
self
.
out
+
fig_names
[
i
]
+
fig_end
)
def
__multiple_plot
(
self
):
os
.
system
(
"
mkdir -p
"
+
self
.
out
)
x_name
=
self
.
file_column_names
[
0
]
fig
=
plt
.
figure
()
if
self
.
oname
==
None
:
fig_names
=
self
.
var
fig_end
=
"
.png
"
else
:
fig_names
=
self
.
oname
fig_end
=
""
for
data
in
self
.
file_data
:
for
y_name
in
self
.
var
:
plt
.
plot
(
data
.
data
[
x_name
],
data
.
data
[
y_name
],
linewidth
=
4
)
for
i
in
range
(
self
.
fig_count
):
y_name
=
self
.
var
[
i
]
fig
=
plt
.
figure
()
for
read_data
in
self
.
file_data
:
plt
.
plot
(
read_data
.
data
[
x_name
],
read_data
.
data
[
y_name
],
linewidth
=
4
)
plt
.
legend
(
self
.
filename
)
plt
.
xlabel
(
x_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
plt
.
ylabel
(
y_name
,
fontsize
=
10
,
fontweight
=
'
bold
'
)
if
self
.
if_manual_plot
:
plt
.
show
()
else
:
plt
.
close
(
fig
)
if
self
.
if_save_result
:
fig
.
savefig
(
self
.
out
+
self
.
oname
[
0
])
if
self
.
if_manual_plot
:
plt
.
show
()
else
:
plt
.
close
(
fig
)
if
self
.
if_save_result
:
fig
.
savefig
(
self
.
out
+
fig_names
[
i
]
+
fig_end
)
def
__get_min_max_ax
(
self
):
min_max_var_vals
=
{
var
:
[]
for
var
in
self
.
var
}
...
...
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