Skip to content
Snippets Groups Projects
Commit b69ce259 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Hiding axis ticks when plotting scenes.

parent 42481d00
No related branches found
No related tags found
No related merge requests found
...@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment