12345678910111213141516171819202122232425262728293031 |
- from matplotlib import pyplot as plt
- def remove_frame(ax, dirs=None):
- if dirs is None:
- dirs = ["right", "left", "top", "bottom"]
- for dir in dirs:
- ax.spines[dir].set_visible(False)
- def remove_ticks(ax):
- ax.xaxis.set_ticks([])
- ax.yaxis.set_ticks([])
- def add_length_scale(ax, scale_length, start_scale_x, end_scale_x, start_scale_y, end_scale_y):
- scale_bar = ax.add_artist(plt.Line2D([start_scale_x, end_scale_x], [start_scale_y, end_scale_y], linewidth=2,
- color='black'))
- scale_bar.set_clip_on(False)
- # axes[0].text(start_scale_x+scale_length/2.0, start_scale_y, , va="top",
- # ha="center", color="k")
- ax.annotate("{:.0f} um".format(scale_length), xy=(start_scale_x + scale_length / 2.0, start_scale_y),
- xytext=(0, -3),
- xycoords="data", textcoords="offset points", va="top", ha="center", annotation_clip=False)
- cm_per_inch = 2.54
- number_of_panels = 4.0
- page_size = 11.4
- panel_size = page_size / number_of_panels / cm_per_inch
- head_direction_input_colormap = 'hsv'
|