We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21d3626 commit e919dcdCopy full SHA for e919dcd
bench_runner/plot.py
@@ -358,13 +358,19 @@ def _standardize_xlims(axs: Sequence[matplotlib.Axes]) -> None: # pyright: igno
358
if not len(axs):
359
return
360
361
- minx, maxx = axs[0].get_xlim()
362
- for ax in axs[1:]:
+ minx = None
+ maxx = None
363
+ for ax in axs:
364
if not ax.has_data():
365
continue
- xlim = ax.get_xlim()
366
- minx = min(minx, xlim[0])
367
- maxx = max(maxx, xlim[1])
+ data = ax.get_lines()[0].get_data()[0]
+ if len(data) > 1:
368
+ xlim = ax.get_xlim()
369
+ if minx is None or maxx is None:
370
+ minx, maxx = xlim
371
+ else:
372
+ minx = min(minx, xlim[0])
373
+ maxx = max(maxx, xlim[1])
374
375
for ax in axs:
376
if ax.has_data():
0 commit comments