File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -486,11 +486,14 @@ def plot2D(
486486
487487 if lim_y_range and viz_type in ["ETC" , "LOGFFT" ]:
488488 _Y_MARGIN = 5
489- _Y_DR = 120 if viz_type == "ETC" else 80
490- # limit layout range of y-axis based on data
489+ _Y_DR = 110 if viz_type == "ETC" else 70
490+
491+ y_min = _np .min ([trace .y .min () for trace in traces ])
491492 y_max = _np .max ([trace .y .max () for trace in traces ])
492- y_max = _np .ceil ((y_max + _Y_MARGIN / 2 ) / _Y_MARGIN ) * _Y_MARGIN
493- layout .yaxis .range = [y_max - _Y_DR , y_max ]
493+ if y_max - y_min > _Y_DR :
494+ # limit layout range of y-axis based on data
495+ y_max = _np .ceil ((y_max + _Y_MARGIN / 2 ) / _Y_MARGIN ) * _Y_MARGIN
496+ layout .yaxis .range = [y_max - _Y_DR , y_max ]
494497
495498 _showTrace (traces , layout = layout , title = title )
496499
You can’t perform that action at this time.
0 commit comments