File tree 2 files changed +18
-10
lines changed
2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 8
8
import scipp as sc
9
9
from ess .reduce .live import raw
10
10
11
- _res_scale = 8
11
+ _res_scale = 12
12
12
13
13
dream_detectors_config = {
14
14
'dashboard' : {'nrow' : 3 , 'ncol' : 2 },
Original file line number Diff line number Diff line change @@ -282,15 +282,23 @@ def maybe_unit(dim: str) -> str:
282
282
unit = data .coords [dim ].unit
283
283
return f' [{ unit } ]' if unit is not None else ''
284
284
285
- fig .update_layout (
286
- title = key ,
287
- width = 500 ,
288
- height = 400 ,
289
- xaxis_title = f'{ x_dim } { maybe_unit (x_dim )} ' ,
290
- yaxis_title = f'{ y_dim } { maybe_unit (y_dim )} ' ,
291
- uirevision = key ,
292
- showlegend = False ,
293
- )
285
+ size = 800
286
+ opts = {
287
+ 'title' : key ,
288
+ 'xaxis_title' : f'{ x_dim } { maybe_unit (x_dim )} ' ,
289
+ 'yaxis_title' : f'{ y_dim } { maybe_unit (y_dim )} ' ,
290
+ 'uirevision' : key ,
291
+ 'showlegend' : False ,
292
+ }
293
+ y_size , x_size = data .shape
294
+ if y_size < x_size :
295
+ fig .update_layout (width = size , ** opts )
296
+ fig .update_yaxes (scaleanchor = "x" , scaleratio = 1 , constrain = "domain" )
297
+ fig .update_xaxes (constrain = "domain" )
298
+ else :
299
+ fig .update_layout (height = size , ** opts )
300
+ fig .update_xaxes (scaleanchor = "y" , scaleratio = 1 , constrain = "domain" )
301
+ fig .update_yaxes (constrain = "domain" )
294
302
return fig
295
303
296
304
def update_plots (self , n : int | None ):
You can’t perform that action at this time.
0 commit comments