|
16 | 16 | from glue.core.roi import XRangeROI |
17 | 17 | from glue.utils.qt import process_events |
18 | 18 | from glue.tests.helpers import requires_matplotlib_ge_22 |
| 19 | +from glue.viewers.matplotlib.state import MatplotlibDataViewerState |
19 | 20 |
|
20 | 21 |
|
21 | 22 | class MatplotlibDrawCounter(object): |
@@ -620,3 +621,26 @@ def test_hide_axes(self): |
620 | 621 |
|
621 | 622 | self.viewer.state.show_axes = True |
622 | 623 | assert self.viewer.axes.axison |
| 624 | + |
| 625 | + def test_update_settings_from(self): |
| 626 | + copy_from_state = MatplotlibDataViewerState() |
| 627 | + copy_from_state.x_axislabel_size = 1 |
| 628 | + copy_from_state.y_axislabel_size = 2 |
| 629 | + copy_from_state.x_axislabel_weight = 'heavy' |
| 630 | + copy_from_state.y_axislabel_weight = 'black' |
| 631 | + copy_from_state.x_ticklabel_size = 5 |
| 632 | + copy_from_state.y_ticklabel_size = 6 |
| 633 | + copy_from_state.show_axes = False |
| 634 | + state = self.viewer.state |
| 635 | + state.update_axes_settings_from(copy_from_state) |
| 636 | + assert state.x_axislabel_size == 1 |
| 637 | + assert state.y_axislabel_size == 2 |
| 638 | + assert state.x_axislabel_weight == 'heavy' |
| 639 | + assert state.y_axislabel_weight == 'black' |
| 640 | + assert state.x_ticklabel_size == 5 |
| 641 | + assert state.y_ticklabel_size == 6 |
| 642 | + assert not state.show_axes |
| 643 | + |
| 644 | + |
| 645 | + |
| 646 | + |
0 commit comments