Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plotting to Smith Charts #4074

Closed
kiranshila opened this issue Jul 23, 2019 · 36 comments · Fixed by #5615 or #5956
Closed

Support plotting to Smith Charts #4074

kiranshila opened this issue Jul 23, 2019 · 36 comments · Fixed by #5615 or #5956
Milestone

Comments

@kiranshila
Copy link

Hey everyone!

I think adding support to plot to Smith Charts would be extremely beneficial to everyone working in RF/Microwave engineering.

It basically is a modified polar plot with a Mobius transform mapping complex numbers onto a polar plane.

image

There are several implementations across a few plotting backends: PGFPlots has it in LaTeX, PySmithChart and Matplotlib have it in Python, it's native in MATLAB, and InspectDR has it in Julia. But none of them implement interactability as well as the leading CAD software which utilizes Smith Charts in design work.

I think Plotly is perfect for this as it can provide a true cross-platform interactive means by which to visualize complex data for radio engineers.

I am more than happy to do a PR, I just need some guidance on how to start working on what is effectively a new axis type.

@joshuaprewitt
Copy link

I agree that it would be really useful to have a smith chart, which can be used when analyzing RF waveforms.

https://cds.cern.ch/record/1417989/files/p95.pdf

@rfriedma
Copy link

I would also like to see smith charts in plotly. I use plotly successfully for displaying engineering data and it would be great to provide a consistent experience to my users for this visualization as well.

@etpinard etpinard mentioned this issue Oct 2, 2019
38 tasks
@etpinard
Copy link
Contributor

etpinard commented Oct 2, 2019

Merged into #2221 - until this gets more traction.

@etpinard etpinard closed this as completed Oct 2, 2019
@lstuemke
Copy link

I have implemented Smith Charts using Plotly for my own personal use. I would love to help add this feature to Plotly if possible. Here are some screenshots of what I've done.

image

One with increased resolution:

image

@kiranshila
Copy link
Author

@lstuemke - Awesome!!! @Gloamglozer and I are working on a PR. Would you like to join? This would be an excellent addition to Plotly and you seem to have a lot of the groundwork figured out.

@lstuemke
Copy link

Yeah absolutely, I'll help out any way I can.

@jensb
Copy link

jensb commented Mar 12, 2020

+1

I'd love to have this as well.

@samuel-schuepbach
Copy link

Were you able to add this to plotly? This feature would be extremely helpful for us as well.
Thanks

@Gloamglozer
Copy link

Gloamglozer commented Apr 15, 2020 via email

@lstuemke
Copy link

@Gloamglozer , I would like to help out with this but not sure the best way to send you my email. I don't really want to post it here. Suggestions?

@lstuemke
Copy link

In the meantime, if you just want to visualize your data you can always plot your mag/angle data using Plotly's Polar Charts. They won't have the Smith gridlines, but it could be a useful workaround before Smith is released.

image

@Gloamglozer
Copy link

Gloamglozer commented Apr 15, 2020 via email

@samuel-schuepbach
Copy link

We are currently using plotly plots quite extensively in our application and are planning to use some sort of smith chart feature in the near future.
So it would be perfect if we could use a plotly smith chart as well.

Keep me up to date if I can help you contributing in some way.

As for the communication, a slack channel might atually be quite useful.

Thank you for the updates.

@Gloamglozer
Copy link

Gloamglozer commented Apr 15, 2020 via email

@Gloamglozer
Copy link

Gloamglozer commented Apr 16, 2020

@lstuemke @rfriedma @samuel-schuepbach @jensb @kiranshila @ilPesce41 @nicolaskruchten

Made a slack for discussion of this here:
https://join.slack.com/t/plotly-js-smith/shared_invite/zt-dlpgredf-L1hhcbnxOQZp0ZmVyiA1_A

Thinking we can just track progress using GithubProjects here:
https://github.com/Gloamglozer/plotly.js/projects/1

As initially suggested by @nicolaskruchten the next step is to sketch out the API for the new smith plot type. We should all have a look and agree on the setup of the API, then have a call with the plotly guys to make sure it looks good to them too and make sure what we're proposing will work well with everything else.

After the API is done division of work will be a lot easier and we will all have the big picture in mind

@nicolaskruchten
Copy link
Contributor

Hi @Gloamglozer, I'm sorry I haven't been able to respond to your email yet. I will try to get to it this week and get this train moving again!

@ajundi
Copy link

ajundi commented Oct 28, 2020

I have implemented Smith Charts using Plotly for my own personal use. I would love to help add this feature to Plotly if possible. Here are some screenshots of what I've done.

image

One with increased resolution:

image

Hi Luke,
Would it be possible to add this to plotly or post the source code in your repo so I can use it? I don't know how to create something like this. Thanks :)

@jensb
Copy link

jensb commented Oct 28, 2020

This looks beautiful. I'd give it +j\infinity stars to be included.

@lstuemke
Copy link

lstuemke commented Oct 28, 2020

This totally fell off my radar @jensb. Let me get back in touch with @Gloamglozer and see where we're at.

Edit: I'm not sure how to get in contact with any of you. Don't particularly want to post my email address here. @kiranshila, @Gloamglozer, do you have a method of communication setup for this project?

@vik-s
Copy link

vik-s commented Nov 10, 2020

Hey, was the smith chart ever incorporated into plotly?

@Gloamglozer
Copy link

Gloamglozer commented Nov 10, 2020 via email

@nicolaskruchten
Copy link
Contributor

@ajundi that looks really amazing! If you want to submit a pull request so we can see how you did it, we'd be happy to review it and work towards getting it incorporated into Plotly!

cc @alexcjohnson check this out!

@lstuemke
Copy link

@nicolaskruchten - Hi Nicolas, it looks like @ajundi was just referencing my post to ask me a question. Anyway, I'd love to help get this incorporated into Plotly.

@nicolaskruchten
Copy link
Contributor

@lstuemke right, my mistake, sorry! Either way, if we can get this into a PR we'd love to help.

@vik-s
Copy link

vik-s commented Nov 10, 2020

Exciting! I would love to see this in plotly. My lack of JS know-how may not help development, but if I can help in testing in python, please let me know. I'm writing a streamlit app to plot RF sparameter data, and plotly would be a prime plotting tool. Smith charts would be awesome obviously!

@jackparmer jackparmer reopened this Jan 13, 2021
@plotly plotly deleted a comment from lstuemke Feb 2, 2021
@mcdevitts
Copy link

Hey all. What's the status here? I'd also love to help out here. I plot s-parameters a lot, and I would love to have an interactive smith chart.

@nicolaskruchten
Copy link
Contributor

@lstuemke we're starting to work on this issue and I'm wondering if you're able and willing to share the code to the partial implementation you've got? :)

@jackparmer
Copy link
Contributor

There's a WIP PR here for anyone who would like to help review:

#5615

image

Hoping to have this in the June release of Plotly.js and Plotly.py.

@nicolaskruchten nicolaskruchten linked a pull request May 1, 2021 that will close this issue
6 tasks
@archmoj archmoj added this to the v2.6.0 milestone Oct 29, 2021
@0xCoto
Copy link

0xCoto commented May 26, 2023

@Gloamglozer @lstuemke @rfriedma @samuel-schuepbach @jensb @kiranshila @ilPesce41 @nicolaskruchten

Hi all, any updates on the Smith chart implementation? I see a Python example here, but I haven't found anything for JS yet. 😕

@archmoj
Copy link
Contributor

archmoj commented May 26, 2023

@0xCoto Implemented in #5956. Please see examples in https://github.com/plotly/plotly.js/pull/5956/files under test/image mocks & baselines.

@lstuemke
Copy link

@Gloamglozer @lstuemke @rfriedma @samuel-schuepbach @jensb @kiranshila @ilPesce41 @nicolaskruchten

Hi all, any updates on the Smith chart implementation? I see a Python example here, but I haven't found anything for JS yet. 😕

Here is a link to some of the documentation: https://plotly.com/javascript/reference/scattersmith/

Hope this helps!

@0xCoto
Copy link

0xCoto commented May 26, 2023

@archmoj @lstuemke Thank you both! I did find the reference, but I'm having a hard time reproducing e.g. when using smith_basic.json, I get this result:

Screenshot 2023-05-26 at 23 15 58

I assume I'm probably making some beginner mistake though

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
  <div id="myChart"></div>

  <script>
    var data = [
      {
        type: "scattersmith",
        real: [0, 0, 1, 1, 2, 5, 10],
        imag: [0, 1, 0, -2, -2, -5, -10],
        mode: "lines+markers",
        marker: {
          size: 20,
          opacity: 0.5
        }
      }
    ];

    var layout = {
      showlegend: false,
      paper_bgcolor: "lightgray",
      margin: {
        t: 40,
        b: 40,
        r: 40,
        l: 40
      },
      width: 800,
      height: 800,
      smith: {
        realaxis: {
          tickvals: [0.2, 0.4, 0.6, 0.8, 1, 1.5, 2, 3, 4, 5, 10, 20]
        }
      }
    };

    Plotly.newPlot("myChart", data, layout);
  </script>
</body>
</html>

@lstuemke
Copy link

lstuemke commented May 27, 2023

Looks like you are using a version of plotly that doesn't have scattersmith implemented yet. Change your plotly reference to something like the following:

<script src="https://cdn.plot.ly/plotly-2.20.0.min.js"></script>

@0xCoto
Copy link

0xCoto commented May 27, 2023

That fixed it, thanks!

@Will-Focus
Copy link

@lstuemke ,
In the samples you posted from your Smith Chart implementation it looks like the density of the gridlines changes in different regions of the chart. Is this still possible in the latest release? I'm looking to generate a Smith Chart similar to this:
smith

The hover text in the samples also shows values as both impedance and normalized impedance. It looks as though the current release expects values to be normalized impedances. Is there a way to use impedances instead?

Thanks

@lstuemke
Copy link

lstuemke commented Jun 1, 2023

@Will-Focus,
Those screenshots were from before Smith was added to Plotly, which I made by hiding the gridlines in a plot and then manually adding a TON of traces in lieu of a grid (as a temporary workaround since it wasn't yet implemented in Plotly).

I ended up not contributing any code, so I cannot speak to what is officially supported. If you'd like, you can message me privately and I can share the Smith gridline math which allows for regions with varying grid density.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet