Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySegCNN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
earth_observation_public
PySegCNN
Commits
b69ce259
Commit
b69ce259
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Hiding axis ticks when plotting scenes.
parent
42481d00
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pysegcnn/core/graphics.py
+9
-7
9 additions, 7 deletions
pysegcnn/core/graphics.py
with
9 additions
and
7 deletions
pysegcnn/core/graphics.py
+
9
−
7
View file @
b69ce259
...
@@ -280,9 +280,9 @@ def plot_sample(x, use_bands, labels,
...
@@ -280,9 +280,9 @@ def plot_sample(x, use_bands, labels,
fig
.
axes
[
0
].
imshow
(
rgb
)
fig
.
axes
[
0
].
imshow
(
rgb
)
# set title
# set title
fig
.
axes
[
0
].
text
(
0.5
,
1.04
,
'
R
=
{}, G
=
{}, B
=
{}
'
.
format
(
*
bands
),
#
fig.axes[0].text(0.5, 1.04, 'R
=
{}, G
=
{}, B
=
{}'.format(*bands),
transform
=
fig
.
axes
[
0
].
transAxes
,
ha
=
'
center
'
,
#
transform=fig.axes[0].transAxes, ha='center',
va
=
'
bottom
'
)
#
va='bottom')
# check whether to plot ground truth
# check whether to plot ground truth
if
y
is
not
None
:
if
y
is
not
None
:
...
@@ -318,17 +318,19 @@ def plot_sample(x, use_bands, labels,
...
@@ -318,17 +318,19 @@ def plot_sample(x, use_bands, labels,
if
not
ax
.
images
:
if
not
ax
.
images
:
fig
.
delaxes
(
ax
)
fig
.
delaxes
(
ax
)
# hide both x and y-ticks
ax
.
set_xticks
([])
ax
.
set_yticks
([])
# hide axis and labels
# hide axis and labels
if
hide_labels
:
if
hide_labels
:
# hide axis ticks, labels and text artists
# hide axis ticks, labels and text artists
ax
.
axis
(
'
off
'
)
ax
.
axis
(
'
off
'
)
for
t
in
ax
.
texts
:
for
t
in
ax
.
texts
:
t
.
set_visible
(
False
)
t
.
set_visible
(
False
)
# adjust spacing when hiding labels
# adjust spacing
if
hide_labels
:
fig
.
subplots_adjust
(
wspace
=
0.02
)
fig
.
subplots_adjust
(
wspace
=
0.02
)
# if a ground truth or a model prediction is plotted, add legend
# if a ground truth or a model prediction is plotted, add legend
if
len
(
fig
.
axes
)
>
1
and
not
hide_labels
:
if
len
(
fig
.
axes
)
>
1
and
not
hide_labels
:
...
...
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