From c55502dc8265da10e3992828308dafd222c55306 Mon Sep 17 00:00:00 2001 From: Rama Vasudevan Date: Fri, 28 Jul 2023 19:26:19 -0400 Subject: [PATCH] add existing ticks --- sidpy/viz/dataset_viz.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sidpy/viz/dataset_viz.py b/sidpy/viz/dataset_viz.py index 08549a3f..860d69de 100644 --- a/sidpy/viz/dataset_viz.py +++ b/sidpy/viz/dataset_viz.py @@ -578,6 +578,16 @@ def __init__(self, dset, figure=None, horizontal=True, **kwargs): else: self.axes[0].set_aspect('equal') + self.axes[0].set_xticks(np.linspace(self.extent[0], self.extent[1], 5), + np.round(np.linspace(self.extent[0], self.extent[1], 5),2)) + self.axes[0].set_yticks(np.linspace(self.extent[2], self.extent[3], 5), + np.round(np.linspace(self.extent[2], self.extent[3], 5),1)) + + self.axes[0].set_xlabel('{} [{}]'.format(self.dset._axes[self.image_dims[0]].quantity, + 'px')) + self.axes[0].set_ylabel('{} [{}]'.format(self.dset._axes[self.image_dims[1]].quantity, + 'px')) + # self.rect = patches.Rectangle((0,0),1,1,linewidth=1,edgecolor='r',facecolor='red', alpha = 0.2) self.rect = patches.Rectangle((0, 0), self.bin_x, self.bin_y, linewidth=1, edgecolor='r', facecolor='red', alpha=0.2) @@ -602,8 +612,9 @@ def __init__(self, dset, figure=None, horizontal=True, **kwargs): import ipywidgets as iwgt self.button = iwgt.widgets.Dropdown( options=[('Pixel Wise', 1), ('Units Wise', 2)], value=1, - description='Pixel Wise or Units Wise Display of Image Data', - tooltip='How to plot spatial data', layout = iwgt.Layout(width='20%', height='50px')) + description='Image', + tooltip='How to plot spatial data: Pixel Wise (by px), Units wise (in given units)', + layout = iwgt.Layout(width='30%', height='50px',)) self.button.observe(self._pw_uw, 'value') #pixel or unit wise self.fig.canvas.draw_idle()