Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Container 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
Tom Rink
python
Commits
633ebfd7
Commit
633ebfd7
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
ee62a446
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
modules/util/plot.py
+17
-0
17 additions, 0 deletions
modules/util/plot.py
with
17 additions
and
0 deletions
modules/util/plot.py
+
17
−
0
View file @
633ebfd7
...
...
@@ -10,6 +10,7 @@ from sklearn.metrics import roc_auc_score, roc_curve
import
tensorflow
as
tf
import
matplotlib
import
matplotlib.pyplot
as
plt
import
cartopy.crs
as
ccrs
import
os
from
util.setup
import
home_dir
...
...
@@ -180,3 +181,19 @@ def plot_image(image, fname, label, cmap='Greys'):
Fig
.
clf
()
# Otherwise fig stays open every time
plt
.
close
()
# Close current figure
# plt.close('all')
def
plot_image2
(
image
,
cmap
=
'
Greys
'
):
fig
=
plt
.
figure
(
figsize
=
(
12
,
8
))
ax
=
plt
.
axes
(
projection
=
ccrs
.
PlateCarree
())
img_extent
=
[
-
180
,
180
,
-
90
,
90
]
ax
.
imshow
(
image
,
origin
=
'
lower
'
,
extent
=
img_extent
,
transform
=
ccrs
.
PlateCarree
(),
cmap
=
cmap
,
vmin
=-
1.5
,
vmax
=
2.5
)
ax
.
coastlines
(
resolution
=
'
50m
'
,
color
=
'
blue
'
,
linewidth
=
1
)
# Save to file
ImageDirAndName
=
os
.
path
.
join
(
'
/Users/tomrink
'
,
'
testimage
'
)
fig
.
savefig
(
ImageDirAndName
)
# Wrap up
fig
.
clf
()
# Otherwise fig stays open every time
plt
.
close
()
# Close current figure
\ No newline at end of file
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