Smith Chart: New plot type for displaying impedance on a circular coordinate system#4634
Smith Chart: New plot type for displaying impedance on a circular coordinate system#4634swharden merged 9 commits intoScottPlot:mainfrom
Conversation
* Custom origin * Added StartAngle and SweepAngle to support arcs
|
Hi @CoderPM2011, WOW this is amazing! This is something users have asked for for many years. You did an awesome job here, thanks so much for this! 🚀 Can you clarify something though - when you said "Parts of the SmithChartAxis source code that require attention", did you mean you're not satisfied with the current implementation? Flipping through the code it looks all right to me... I'll add a few cookbook recipes demonstrating this (committing to this branch), merge it in today, and make an announcement tagging a bunch of old issues and users who asked for this over the years. |
|
Hi @CoderPM2011, I refined the styling a bit. What do you think of this cookbook recipe? Can you think of additional recipes that users may find useful while keeping the number of lines of code low? var smith = myPlot.Add.SmithChartAxis();
// translate an impedance location on the Smith chart to a 2D location on the plot
double resistance = 0.2;
double reactance = -0.5;
Coordinates location = smith.GetCoordinates(resistance, reactance);
// use that location to add traditional plot components
myPlot.Add.Marker(location, MarkerShape.FilledCircle, size: 15, Colors.Red);
var txt = myPlot.Add.Text("0.2 - j 0.5", location);
txt.LabelStyle.FontSize = 24;
txt.LabelStyle.Bold = true;
txt.LabelStyle.ForeColor = Colors.Red; |
Sorry for the misunderstanding. 😅 |
|
@swharden this looks good👍 I'm not very familiar with this kind of picture so don't have any more use case ideas at the moment. 😥 |

resolve #4578.
This is just a simple implementation, no other additional content is considered.
I added
SmithChartAxisaccording to thePolarAxisclass, so they have a consistent usage concept.To implement
SmithChartAxis, I addedDrawing.DrawArcmethod and extendedPolarAxisCircle.Parts of the
SmithChartAxissource code that require attentionstatic method
CalculateGammaConvert impedance(R+jX) to Cartesian coordinates (x, y) for display.
axis set method
SetConstantRealPartsSetConstantImaginaryPartsPlot.Add.SmithChartAxis()actually presets the axis:demo
demo code