Skip to content

Commit

Permalink
Handle updates to inherited plot options
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 6, 2018
1 parent 3a4cdd4 commit ae55fb2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions holoviews/tests/plotting/bokeh/testoverlayplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ def test_overlay_update_plot_opts(self):
plot.update((1,))
self.assertEqual(plot.state.title.text, 'B')

def test_overlay_update_plot_opts_inherited(self):
hmap = HoloMap(
{0: (Curve([]).options(title_format='A') * Curve([])),
1: (Curve([]).options(title_format='B') * Curve([]))}
)
plot = bokeh_renderer.get_plot(hmap)
self.assertEqual(plot.state.title.text, 'A')
plot.update((1,))
self.assertEqual(plot.state.title.text, 'B')

def test_points_errorbars_text_ndoverlay_categorical_xaxis(self):
overlay = NdOverlay({i: Points(([chr(65+i)]*10,np.random.randn(10)))
for i in range(5)})
Expand Down
10 changes: 10 additions & 0 deletions holoviews/tests/plotting/matplotlib/testoverlayplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ def test_overlay_update_plot_opts(self):
plot.update((1,))
self.assertEqual(plot.handles['title'].get_text(), 'B')

def test_overlay_update_plot_opts_inherited(self):
hmap = HoloMap(
{0: (Curve([]).options(title_format='A') * Curve([])),
1: (Curve([]).options(title_format='B') * Curve([]))}
)
plot = mpl_renderer.get_plot(hmap)
self.assertEqual(plot.handles['title'].get_text(), 'A')
plot.update((1,))
self.assertEqual(plot.handles['title'].get_text(), 'B')

def test_overlay_apply_ranges_disabled(self):
overlay = (Curve(range(10)) * Curve(range(10))).options('Curve', apply_ranges=False)
plot = mpl_renderer.get_plot(overlay)
Expand Down

0 comments on commit ae55fb2

Please sign in to comment.