Superimpose Contours on Scattersmith

Hello everyone.

I work in the RF world, and I’m trying to plot contours on top of a smith chart. This is a fairly common task that’s previously been accomplished in MATLAB, but I’m working on setting up an interactive dashboard with Dash.

For my prototype, I tried the following.

fig = go.Figure()

fig.add_trace(
    go.Contour(
        x=xr[0],
        y=yr[:, 0],
        z=z,
        contours_coloring='lines'
    )
)

fig.add_trace(
    go.Scattersmith(
        real=df['Zl'].apply(lambda x: x.real/50), 
        imag=df['Zl'].apply(lambda x: x.imag/50),
        mode='markers'
    )
)

fig.show()

I played around with the order of operations, but the result was the same. You get a smith chart in the middle of the display, and then the contour plot in the background on a different set of axes.

Ultimately I’d like to have a smith chart with scattered data, and superimpose contours on top of the smith chart. The points represent where data has been measured, and the contours show the parameters of interest. I’m new to plotly and Dash so I’m not sure how to go about this.

Below is a plot of roughly what I’m trying to achieve.

636541199293901003-loadpull_clip_image0021
(Credit: Microwaves101 | Load Pull for Power Devices)