fix(compliance): square plot box (set_box_aspect) so the chart isn't squashed
The compliance chart sits in the short, wide mic-and-USBM band on the event report; without a fixed aspect matplotlib stretched it wide-and-short. Force a square plot box, which is how log-log compliance charts are conventionally drawn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDXjZCr4RqT2U3QvMDhgzf
This commit is contained in:
@@ -120,6 +120,7 @@ def draw_compliance_chart(ax, channels: Dict[str, Sequence[float]], sps: float)
|
|||||||
ax.set_yscale("log")
|
ax.set_yscale("log")
|
||||||
ax.set_xlim(1, 100)
|
ax.set_xlim(1, 100)
|
||||||
ax.set_ylim(0.0394, 10)
|
ax.set_ylim(0.0394, 10)
|
||||||
|
ax.set_box_aspect(1) # square plot box (log-log compliance charts are square)
|
||||||
xt = [1, 2, 5, 10, 20, 50, 100]
|
xt = [1, 2, 5, 10, 20, 50, 100]
|
||||||
yt = [0.0394, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10]
|
yt = [0.0394, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10]
|
||||||
ax.xaxis.set_major_locator(FixedLocator(xt)); ax.xaxis.set_minor_locator(NullLocator())
|
ax.xaxis.set_major_locator(FixedLocator(xt)); ax.xaxis.set_minor_locator(NullLocator())
|
||||||
|
|||||||
Reference in New Issue
Block a user