Skip to content

Commit

Permalink
show_axis option to show axis
Browse files Browse the repository at this point in the history
  • Loading branch information
guiwitz committed Jul 12, 2022
1 parent 59bbc1c commit c0666e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions microfilm/microanim.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
scalebar_font_size=12, scalebar_kwargs=None, scalebar_font_properties=None,
ax=None, fig_scaling=3, dpi=72, label_text=None, label_location='upper left',
label_color='white', label_font_size=15, label_kwargs={}, cmap_objects=None,
show_colorbar=False, show_plot=True
show_colorbar=False, show_axis=False, show_plot=True
):
super().__init__(
images=None, cmaps=cmaps, flip_map=flip_map, rescale_type=rescale_type, limits=limits,
Expand All @@ -39,7 +39,7 @@ def __init__(
scalebar_font_size=scalebar_font_size, scalebar_kwargs=scalebar_kwargs, scalebar_font_properties=scalebar_font_properties,
ax=ax, fig_scaling=fig_scaling, dpi=dpi, label_text=label_text, label_location=label_location,
label_color=label_color, label_font_size=label_font_size, label_kwargs=label_kwargs, cmap_objects=cmap_objects,
show_colorbar=show_colorbar
show_colorbar=show_colorbar, show_axis=show_axis
)

# check for correct dimensions
Expand Down
16 changes: 11 additions & 5 deletions microfilm/microplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def microshow(
scalebar_font_size=12, scalebar_kwargs=None, scalebar_font_properties=None,
ax=None, fig_scaling=3, dpi=72, label_text=None, label_location='upper left',
label_color='white', label_font_size=15, label_kwargs={}, cmap_objects=None,
show_colorbar=False, microim=None
show_colorbar=False, show_axis=False, microim=None
):
"""
Plot image
Expand Down Expand Up @@ -109,6 +109,8 @@ def microshow(
if provided, the cmap names are ignored
show_colorbar: bool
show colorbar
show_axis: bool
show plot axis
microim: Microimage object
object to re-use
Expand All @@ -134,7 +136,7 @@ def microshow(
scalebar_font_properties=scalebar_font_properties, ax=ax, fig_scaling=fig_scaling,
dpi=dpi, label_text=label_text, label_location=label_location,
label_color=label_color, label_font_size=label_font_size, label_kwargs=label_kwargs,
cmap_objects=cmap_objects, show_colorbar=show_colorbar
cmap_objects=cmap_objects, show_colorbar=show_colorbar, show_axis=show_axis
)

microim.rescale_type = colorify.check_rescale_type(microim.rescale_type, microim.limits)
Expand Down Expand Up @@ -162,12 +164,14 @@ def microshow(
microim.fig = plt.figure(frameon=False, dpi=microim.dpi)
microim.fig.set_size_inches(width_scaled, height_scaled, forward=False)
microim.ax = plt.Axes(microim.fig, [0.0, 0.0, 1.0, 1.0])
microim.ax.set_axis_off()
if not show_axis:
microim.ax.set_axis_off()
microim.fig.add_axes(microim.ax)
else:
microim.fig = microim.ax.figure
microim.ax.imshow(converted, interpolation='nearest')
microim.ax.set_axis_off()
if not show_axis:
microim.ax.set_axis_off()

if microim.channel_names is None:
microim.channel_names = channel_names
Expand Down Expand Up @@ -302,6 +306,8 @@ class Microimage:
if provided, cmap names are ignored
show_colorbar: bool
show colorbar
show_axis: bool
show plot axis
"""

Expand All @@ -314,7 +320,7 @@ def __init__(
scalebar_font_size=12, scalebar_kwargs=None, scalebar_font_properties=None,
ax=None, fig_scaling=3, dpi=72, label_text=None, label_location='upper left',
label_color='white', label_font_size=15, label_kwargs={}, cmap_objects=None,
show_colorbar=False
show_colorbar=False, show_axis=False
):

self.__dict__.update(locals())
Expand Down

0 comments on commit c0666e1

Please sign in to comment.