Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent matplotlib warning #371

Merged
merged 2 commits into from
Jan 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions proseco/report_acq.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import matplotlib
matplotlib.use('agg') # noqa
from matplotlib import patches
from matplotlib.ticker import FixedLocator
import matplotlib.pyplot as plt
import numpy as np
from jinja2 import Template
@@ -473,10 +474,14 @@ def plot_imposters(acq, dark, dither, vmin=100, vmax=2000,

# Hack to fix up ticks to have proper row/col coords. There must be a
# correct way to do this.
xticks = [str(int(label) + img.row0) for label in ax.get_xticks().tolist()]
xticks_loc = ax.get_xticks().tolist()
xticks = [str(int(label) + img.row0) for label in xticks_loc]
ax.xaxis.set_major_locator(FixedLocator(xticks_loc))
ax.set_xticklabels(xticks)
ax.set_xlabel('Row')
yticks = [str(int(label) + img.col0) for label in ax.get_yticks().tolist()]
yticks_loc = ax.get_yticks().tolist()
yticks = [str(int(label) + img.col0) for label in yticks_loc]
ax.yaxis.set_major_locator(FixedLocator(yticks_loc))
ax.set_yticklabels(yticks)
ax.set_ylabel('Column')
ax.set_title('Red boxes show search box size + dither')