The current legend_tracegroupgap implementation is in pixel. Desired behavior: if I have 2 subplots (col=2, row=1) to be able to enable legend_per_subplot = True Default vertical legend on the right side: subplot(2 traces) | Legend with 2 traces subplot(4 traces) | Legend with 4 traces The workaround with legend_tracegroupgap does not match the need as they are expressed in pixels instead of domain-like subplots.