Skip to content

Commit

Permalink
styling updates
Browse files Browse the repository at this point in the history
* invert toolbar in dark mode
* connect lines when applicable in radial profile
* sci notation on y-axis for line profile and radial profile
  • Loading branch information
kecnry committed Oct 10, 2023
1 parent 71d073e commit a03a9da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jdaviz/components/plugin_plot.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="plugin-plot-component" style="margin-bottom: 40px">
<v-row dense style="margin: 0px 0px -8px 0px !important">
<jupyter-widget class='plugin-nested-toolbar' :widget="toolbar"></jupyter-widget>
<jupyter-widget class='plugin-nested-toolbar invert-if-dark' :widget="toolbar"></jupyter-widget>
<v-spacer></v-spacer>
<div style="line-height: 40px; width=32px" class="only-show-in-tray">
<j-plugin-popout :popout_button="popout_button"></j-plugin-popout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def __init__(self, *args, **kwargs):
self.current_plot_type = self.plot_types[0]
self._fitted_model_name = 'phot_radial_profile'

self.plot.viewer.axis_y.tick_format = '0.2e'

self.session.hub.subscribe(self, SubsetUpdateMessage, handler=self._on_subset_update)
self.session.hub.subscribe(self, LinkUpdatedMessage, handler=self._on_link_update)

Expand Down Expand Up @@ -330,7 +332,7 @@ def vue_do_aper_phot(self, *args, **kwargs):
comp_data, (xcenter, ycenter), aperture, phot_table['sum'][0],
wcs=data.coords, background=bg, pixarea_fac=pixarea_fac)
self.plot._update_data('profile', x=x_arr, y=sum_arr, reset_lims=True)
self.plot.update_style('profile', color='gray', size=32)
self.plot.update_style('profile', line_visible=True, color='gray', size=32)
self.plot.update_style('fit', visible=False)
self.plot.figure.axes[0].label = x_label
self.plot.figure.axes[1].label = y_label
Expand All @@ -345,7 +347,7 @@ def vue_do_aper_phot(self, *args, **kwargs):
phot_aperstats.data_cutout, phot_aperstats.bbox, (xcenter, ycenter),
raw=False)
self.plot._update_data('profile', x=x_data, y=y_data, reset_lims=True)
self.plot.update_style('profile', color='gray', size=32)
self.plot.update_style('profile', line_visible=True, color='gray', size=32)

else: # Radial Profile (Raw)
self.plot.figure.title = 'Raw radial profile from aperture center'
Expand All @@ -354,7 +356,7 @@ def vue_do_aper_phot(self, *args, **kwargs):
raw=True)

self.plot._update_data('profile', x=x_data, y=y_data, reset_lims=True)
self.plot.update_style('profile', color='gray', size=1)
self.plot.update_style('profile', line_visible=False, color='gray', size=1)

# Fit Gaussian1D to radial profile data.
if self.fit_radial_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ def vue_draw_plot(self, msg={}):
self.plot_across_x.update_style('line', line_visible=True,
markers_visible=False, color='gray')
self.plot_across_x.figure.axes[1].label = y_label
self.plot_across_x.viewer.axis_y.tick_format = '0.2e'

self.plot_across_y.figure.title = f'Y={y}'
self.plot_across_y._update_data('line', x=range(comp.data.shape[1]), y=comp.data[y, :],
reset_lims=True)
self.plot_across_y.update_style('line', line_visible=True,
markers_visible=False, color='gray')
self.plot_across_y.figure.axes[1].label = y_label
self.plot_across_y.viewer.axis_y.tick_format = '0.2e'

self.plot_available = True

0 comments on commit a03a9da

Please sign in to comment.