Skip to content

Scattersmith

Overview

The scattersmith trace type is used to create scatter plots on a Smith chart, which is typically used in electrical engineering to represent complex impedance and reflection coefficients in transmission lines. It allows for plotting data in terms of complex numbers (real and imaginary components), making it ideal for analyzing electrical circuits.

You can customize the marker size, color, and lines to connect points, similar to scatter plots, but specifically tailored for Smith charts.

Common Uses

  • Impedance and Reflection Coefficients: Visualizing electrical properties in transmission lines.
  • Complex Data Visualization: Representing data points in terms of complex numbers in a specialized format.
  • Electrical Engineering Analysis: Ideal for RF and microwave engineering applications.

Check out the Attributes for the full set of configuration options

Examples

Common Configurations

Here's a simple scattersmith plot showing data points on a Smith chart:

You can copy this code below to create this chart in your project:

models:
  - name: scattersmith-data
    args:
      - echo
      - |
        real,imaginary
        0.5,0.2
        0.8,0.3
        1.0,0.5
        1.2,0.7
traces:
  - name: Simple Scattersmith Plot
    model: ${ref(scattersmith-data)}
    props:
      type: scattersmith
      real: ?{real}
      imag: ?{imaginary}
      mode: "markers"
charts:
  - name: Simple Scattersmith Chart
    traces:
      - ${ref(Simple Scattersmith Plot)}
    layout:
      title:
        text: Simple Scattersmith Plot<br><sub>Data Points on Smith Chart</sub>

This example demonstrates a scattersmith plot with lines connecting the data points on a Smith chart:

Here's the code:

models:
  - name: scattersmith-data-lines
    args:
      - echo
      - |
        real,imaginary
        0.2,0.1
        0.5,0.4
        0.7,0.6
        1.0,0.8
traces:
  - name: Scattersmith Plot with Lines
    model: ${ref(scattersmith-data-lines)}
    props:
      type: scattersmith
      real: ?{real}
      imag: ?{imaginary}
      mode: "lines+markers"
charts:
  - name: Scattersmith Chart with Lines
    traces:
      - ${ref(Scattersmith Plot with Lines)}
    layout:
      title:
        text: Scattersmith Plot with Lines<br><sub>Connecting Data Points on Smith Chart</sub>

Here's a scattersmith plot with custom marker sizes and colors, giving more visual weight to each data point on a Smith chart:

Here's the code:

models:
  - name: scattersmith-data-custom
    args:
      - echo
      - |
        real,imaginary,size,color
        0.5,0.2,10,#1f77b4
        0.8,0.3,15,#ff7f0e
        1.0,0.5,20,#2ca02c
        1.2,0.7,25,#d62728
traces:
  - name: Scattersmith Plot with Custom Markers
    model: ${ref(scattersmith-data-custom)}
    props:
      type: scattersmith
      real: ?{real}
      imag: ?{imaginary}
      mode: "markers"
      marker:
        size: ?{size}
        color: ?{color}
charts:
  - name: Scattersmith Chart with Custom Markers
    traces:
      - ${ref(Scattersmith Plot with Custom Markers)}
    layout:
      title:
        text: Scattersmith Plot with Custom Markers<br><sub>Custom Sizes and Colors for Smith Chart Data Points</sub>

A schema to validate plotly trace properties

Attributes

These attributes apply to traces where trace.props.type is set to scattersmith. You would configure these attributes on the trace with the trace.props object.

cliponaxis: boolean
connectgaps: boolean
customdata: array
customdatasrc: 'string' #(1)!
fill: any
fillcolor: any
hoverinfo: array
hoverinfosrc: 'string' #(2)!
hoverlabel:
  align: array
  alignsrc: 'string' #(3)!
  bgcolor: array
  bgcolorsrc: 'string' #(4)!
  bordercolor: array
  bordercolorsrc: 'string' #(5)!
  font:
    color: array
    colorsrc: 'string' #(6)!
    family: 'string | array' #(7)!
    familysrc: 'string' #(8)!
    lineposition: array
    linepositionsrc: 'string' #(9)!
    shadow: 'string | array' #(10)!
    shadowsrc: 'string' #(11)!
    size: array
    sizesrc: 'string' #(12)!
    style: array
    stylesrc: 'string' #(13)!
    textcase: array
    textcasesrc: 'string' #(14)!
    variant: array
    variantsrc: 'string' #(15)!
    weight: array
    weightsrc: 'string' #(16)!
  namelength: array
  namelengthsrc: 'string' #(17)!
hoveron: string
hovertemplate: 'string | array' #(18)!
hovertemplatesrc: 'string' #(19)!
hovertext: 'string | array' #(20)!
hovertextsrc: 'string' #(21)!
ids: array
idssrc: 'string' #(22)!
imag: array
imagsrc: 'string' #(23)!
legend: string
legendgroup: 'string' #(24)!
legendgrouptitle:
  font:
    color: any
    family: 'string' #(25)!
    lineposition: any
    shadow: 'string' #(26)!
    size: number
    style: any
    textcase: any
    variant: any
    weight: integer
  text: 'string' #(27)!
legendrank: number
legendwidth: number
line:
  backoff: array
  backoffsrc: 'string' #(28)!
  color: any
  dash: 'string' #(29)!
  shape: any
  smoothing: number
  width: number
marker:
  angle: array
  angleref: any
  anglesrc: 'string' #(30)!
  autocolorscale: boolean
  cauto: boolean
  cmax: number
  cmid: number
  cmin: number
  color: array
  coloraxis: string
  colorbar:
    bgcolor: any
    bordercolor: any
    borderwidth: number
    exponentformat: any
    len: number
    lenmode: any
    minexponent: number
    nticks: integer
    orientation: any
    outlinecolor: any
    outlinewidth: number
    separatethousands: boolean
    showexponent: any
    showticklabels: boolean
    showtickprefix: any
    showticksuffix: any
    thickness: number
    thicknessmode: any
    tickangle: number
    tickcolor: any
    tickfont:
      color: any
      family: 'string' #(31)!
      lineposition: any
      shadow: 'string' #(32)!
      size: number
      style: any
      textcase: any
      variant: any
      weight: integer
    tickformat: 'string' #(33)!
    tickformatstops: array
    ticklabeloverflow: any
    ticklabelposition: any
    ticklabelstep: integer
    ticklen: number
    tickmode: any
    tickprefix: 'string' #(34)!
    ticks: any
    ticksuffix: 'string' #(35)!
    ticktext: array
    ticktextsrc: 'string' #(36)!
    tickvals: array
    tickvalssrc: 'string' #(37)!
    tickwidth: number
    title:
      font:
        color: any
        family: 'string' #(38)!
        lineposition: any
        shadow: 'string' #(39)!
        size: number
        style: any
        textcase: any
        variant: any
        weight: integer
      side: any
      text: 'string' #(40)!
    x: number
    xanchor: any
    xpad: number
    xref: any
    y: number
    yanchor: any
    ypad: number
    yref: any
  colorscale: any
  colorsrc: 'string' #(41)!
  gradient:
    color: array
    colorsrc: 'string' #(42)!
    type: array
    typesrc: 'string' #(43)!
  line:
    autocolorscale: boolean
    cauto: boolean
    cmax: number
    cmid: number
    cmin: number
    color: array
    coloraxis: string
    colorscale: any
    colorsrc: 'string' #(44)!
    reversescale: boolean
    width: array
    widthsrc: 'string' #(45)!
  maxdisplayed: number
  opacity: array
  opacitysrc: 'string' #(46)!
  reversescale: boolean
  showscale: boolean
  size: array
  sizemin: number
  sizemode: any
  sizeref: number
  sizesrc: 'string' #(47)!
  standoff: array
  standoffsrc: 'string' #(48)!
  symbol: array
  symbolsrc: 'string' #(49)!
metasrc: 'string' #(50)!
mode: any
name: 'string' #(51)!
opacity: number
real: array
realsrc: 'string' #(52)!
selected:
  marker:
    color: any
    opacity: number
    size: number
  textfont:
    color: any
showlegend: boolean
stream:
  maxpoints: number
  token: 'string' #(53)!
subplot: string
text: 'string | array' #(54)!
textfont:
  color: array
  colorsrc: 'string' #(55)!
  family: 'string | array' #(56)!
  familysrc: 'string' #(57)!
  lineposition: array
  linepositionsrc: 'string' #(58)!
  shadow: 'string | array' #(59)!
  shadowsrc: 'string' #(60)!
  size: array
  sizesrc: 'string' #(61)!
  style: array
  stylesrc: 'string' #(62)!
  textcase: array
  textcasesrc: 'string' #(63)!
  variant: array
  variantsrc: 'string' #(64)!
  weight: array
  weightsrc: 'string' #(65)!
textposition: array
textpositionsrc: 'string' #(66)!
textsrc: 'string' #(67)!
texttemplate: 'string | array' #(68)!
texttemplatesrc: 'string' #(69)!
type: scattersmith
uid: 'string' #(70)!
unselected:
  marker:
    color: any
    opacity: number
    size: number
  textfont:
    color: any
visible: any
  1. Sets the source reference on Chart Studio Cloud for customdata.
  2. Sets the source reference on Chart Studio Cloud for hoverinfo.
  3. Sets the source reference on Chart Studio Cloud for align.
  4. Sets the source reference on Chart Studio Cloud for bgcolor.
  5. Sets the source reference on Chart Studio Cloud for bordercolor.
  6. Sets the source reference on Chart Studio Cloud for color.
  7. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  8. Sets the source reference on Chart Studio Cloud for family.
  9. Sets the source reference on Chart Studio Cloud for lineposition.
  10. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  11. Sets the source reference on Chart Studio Cloud for shadow.
  12. Sets the source reference on Chart Studio Cloud for size.
  13. Sets the source reference on Chart Studio Cloud for style.
  14. Sets the source reference on Chart Studio Cloud for textcase.
  15. Sets the source reference on Chart Studio Cloud for variant.
  16. Sets the source reference on Chart Studio Cloud for weight.
  17. Sets the source reference on Chart Studio Cloud for namelength.
  18. Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%xother}, {%_xother}, {%xother_}. When showing info for several points, xother will be added to those with different x positions from the first point. An underscore before or after (x|y)other will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Anything contained in tag <extra> is displayed in the secondary box, for example "{fullData.name}". To hide the secondary box completely, use an empty tag <extra></extra>.
  19. Sets the source reference on Chart Studio Cloud for hovertemplate.
  20. Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace hoverinfo must contain a text flag.
  21. Sets the source reference on Chart Studio Cloud for hovertext.
  22. Sets the source reference on Chart Studio Cloud for ids.
  23. Sets the source reference on Chart Studio Cloud for imag.
  24. Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items.
  25. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  26. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  27. Sets the title of the legend group.
  28. Sets the source reference on Chart Studio Cloud for backoff.
  29. Sets the dash style of lines. Set to a dash type string (solid, dot, dash, longdash, dashdot, or longdashdot) or a dash length list in px (eg 5px,10px,2px,2px).
  30. Sets the source reference on Chart Studio Cloud for angle.
  31. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  32. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  33. Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46
  34. Sets a tick label prefix.
  35. Sets a tick label suffix.
  36. Sets the source reference on Chart Studio Cloud for ticktext.
  37. Sets the source reference on Chart Studio Cloud for tickvals.
  38. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  39. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  40. Sets the title of the color bar.
  41. Sets the source reference on Chart Studio Cloud for color.
  42. Sets the source reference on Chart Studio Cloud for color.
  43. Sets the source reference on Chart Studio Cloud for type.
  44. Sets the source reference on Chart Studio Cloud for color.
  45. Sets the source reference on Chart Studio Cloud for width.
  46. Sets the source reference on Chart Studio Cloud for opacity.
  47. Sets the source reference on Chart Studio Cloud for size.
  48. Sets the source reference on Chart Studio Cloud for standoff.
  49. Sets the source reference on Chart Studio Cloud for symbol.
  50. Sets the source reference on Chart Studio Cloud for meta.
  51. Sets the trace name. The trace name appears as the legend item and on hover.
  52. Sets the source reference on Chart Studio Cloud for real.
  53. The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
  54. Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace hoverinfo contains a text flag and hovertext is not set, these elements will be seen in the hover labels.
  55. Sets the source reference on Chart Studio Cloud for color.
  56. HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
  57. Sets the source reference on Chart Studio Cloud for family.
  58. Sets the source reference on Chart Studio Cloud for lineposition.
  59. Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
  60. Sets the source reference on Chart Studio Cloud for shadow.
  61. Sets the source reference on Chart Studio Cloud for size.
  62. Sets the source reference on Chart Studio Cloud for style.
  63. Sets the source reference on Chart Studio Cloud for textcase.
  64. Sets the source reference on Chart Studio Cloud for variant.
  65. Sets the source reference on Chart Studio Cloud for weight.
  66. Sets the source reference on Chart Studio Cloud for textposition.
  67. Sets the source reference on Chart Studio Cloud for text.
  68. Template string used for rendering the information text that appear on points. Note that this will override textinfo. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Finally, the template string has access to variables real, imag and text.
  69. Sets the source reference on Chart Studio Cloud for texttemplate.
  70. Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.