Skip to content

Commit dab3584

Browse files
committed
fix wrong midpoint calculation (adust_x and adjust_y mode). For graph_widget_twinx.py add back/foward options. add pan_x and pan_y options. add adjust_x and adjust_y options.
1 parent 576179e commit dab3584

File tree

15 files changed

+530
-77
lines changed

15 files changed

+530
-77
lines changed

example_all_interactive_options/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_basic/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_big_data/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_cursor/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_cursor_scatter_experimental/graph_widget_scatter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def apply_pan(self, ax, event, mode='pan'):
782782
if not mode=='pan_y' and not mode=='adjust_y':
783783
if mode=='adjust_x':
784784
if self.anchor_x is None:
785-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
785+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
786786
if xdata>midpoint:
787787
self.anchor_x='left'
788788
else:
@@ -802,7 +802,7 @@ def apply_pan(self, ax, event, mode='pan'):
802802
if not mode=='pan_x' and not mode=='adjust_x':
803803
if mode=='adjust_y':
804804
if self.anchor_y is None:
805-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
805+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
806806
if ydata>midpoint:
807807
self.anchor_y='top'
808808
else:

example_legend/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_legend_horizontal/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_legend_matplotlib/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

example_live_data/graph_widget.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def apply_pan(self, ax, event, mode='pan'):
655655
if not mode=='pan_y' and not mode=='adjust_y':
656656
if mode=='adjust_x':
657657
if self.anchor_x is None:
658-
midpoint= (cur_xlim[1] - cur_xlim[0])/2
658+
midpoint= (cur_xlim[1] + cur_xlim[0])/2
659659
if xdata>midpoint:
660660
self.anchor_x='left'
661661
else:
@@ -675,7 +675,7 @@ def apply_pan(self, ax, event, mode='pan'):
675675
if not mode=='pan_x' and not mode=='adjust_x':
676676
if mode=='adjust_y':
677677
if self.anchor_y is None:
678-
midpoint= (cur_ylim[1] - cur_ylim[0])/2
678+
midpoint= (cur_ylim[1] + cur_ylim[0])/2
679679
if ydata>midpoint:
680680
self.anchor_y='top'
681681
else:

0 commit comments

Comments
 (0)