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
16d9d896
Commit
16d9d896
authored
1 year ago
by
数学の武士
Browse files
Options
Downloads
Patches
Plain Diff
Add multiple plot, need check
parent
590097fb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plotter/Plotter.py
+26
-2
26 additions, 2 deletions
plotter/Plotter.py
plotter/__init__.py
+1
-1
1 addition, 1 deletion
plotter/__init__.py
plotter/main.py
+6
-0
6 additions, 0 deletions
plotter/main.py
with
33 additions
and
3 deletions
plotter/Plotter.py
+
26
−
2
View file @
16d9d896
...
...
@@ -88,7 +88,7 @@ class Plotter:
if
args
.
func
!=
self
.
dump
:
if
args
.
func
==
self
.
plot
or
args
.
func
==
self
.
ani_plot
:
if
args
.
func
==
self
.
plot
or
args
.
func
==
self
.
ani_plot
or
args
.
func
==
self
.
multiple_plot
:
self
.
ndim
=
1
elif
args
.
func
==
self
.
plot_contour
or
args
.
func
==
self
.
ani_plot_contour
:
self
.
ndim
=
2
...
...
@@ -113,11 +113,31 @@ class Plotter:
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
])
def
__multiple_plot
(
self
):
os
.
system
(
"
mkdir -p
"
+
self
.
out
)
x_name
=
self
.
file_column_names
[
0
]
fig
=
plt
.
figure
()
for
data
in
self
.
file_data
:
for
y_name
in
self
.
var
:
plt
.
plot
(
data
.
data
[
x_name
],
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
])
def
__get_min_max_ax
(
self
):
min_max_var_vals
=
{
var
:
[]
for
var
in
self
.
var
}
...
...
@@ -432,4 +452,8 @@ class Plotter:
def
get_data
(
self
):
return_data
=
[
copy
.
deepcopy
(
data
.
data
)
for
data
in
self
.
file_data
]
return
return_data
\ No newline at end of file
return
return_data
def
multiple_plot
(
self
):
self
.
__get_min_max_ax
()
self
.
__multiple_plot
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
plotter/__init__.py
+
1
−
1
View file @
16d9d896
...
...
@@ -8,4 +8,4 @@ from .main import ani_plot_contour
from
.main
import
avg_plot
from
.main
import
plot_diff
from
.main
import
get_data
from
.main
import
multiple_plot
This diff is collapsed.
Click to expand it.
plotter/main.py
+
6
−
0
View file @
16d9d896
...
...
@@ -20,6 +20,12 @@ def plot(filename, out = './', oname = 'fig.png', var=[None], mval=[None], min_y
Plot
.
set
(
args
,
if_manual_plot
=
manual_plot
,
if_save_result
=
save_result
)
Plot
.
plot
()
def
multiple_plot
(
filename
,
out
=
'
./
'
,
oname
=
'
fig.png
'
,
var
=
[
None
],
mval
=
[
None
],
min_y
=
None
,
max_y
=
None
):
Plot
=
Plotter
()
args
=
Args
(
filename
,
Plot
.
multiple_plot
,
var
=
var
,
mval
=
mval
,
oname
=
oname
,
out
=
out
)
Plot
.
set
(
args
,
if_manual_plot
=
manual_plot
,
if_save_result
=
save_result
)
Plot
.
multiple_plot
()
def
ani_plot
(
filename
,
out
=
'
./
'
,
oname
=
'
fig.gif
'
,
var
=
[
None
],
mval
=
[
None
],
min_y
=
None
,
max_y
=
None
):
pp
=
str
(
PurePath
(
filename
).
parent
)
+
'
/
'
name
=
str
(
PurePath
(
filename
).
name
)
...
...
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