我有以下代码来绘制"共振线":
TuneDiagram[MyOrder_, MyColor_] := Module[{},
myLines =
Partition[
Flatten[Table[{{A -> a, B -> +MyOrder - a, C -> p}, {A -> a,
B -> -MyOrder + a, C -> p}}, {a, 0, MyOrder}, {p, -MyOrder,
MyOrder}]], 3];
myEquation = A x + B y == C /. myLines;
ContourPlot[Evaluate[myEquation], {x, 0, 1}, {y, 0, 1},
ContourStyle -> MyColor, PlotRangePadding -> None,
GridLines -> None,
]]
我可以获得像这样的情节。
我希望使用Python
/ matplotlib
获得相同的结果。
我对"翻译感到困惑"这种编程风格到Python上。任何指针都会非常感激!