original_docstring: 
              Generates a Plotly figure of the spectrum. If U-lines are
              present, it will plot the simulated spectrum also.
          
docstring: Generates a Plotly figure of the spectrum. If U-lines are
  present, it will plot the simulated spectrum also.
docstring_tokens: Generates a Plotly figure of the spectrum . If U - lines are present it will plot the simulated spectrum also .
code: def plot_spectrum(self, simulate=False):
          """
              Generates a Plotly figure of the spectrum. If U-lines are
              present, it will plot the simulated spectrum also.
          """
          fig = go.FigureWidget()
  
          fig.layout["xaxis"]["title"] = "Frequency (MHz)"
          fig.layout["xaxis"]["tickformat"] = ".,"
          fig.layout["yaxis"]["title"] = str(self.int_col)
  
          fig.add_scattergl(
              x=self.data[self.freq_col],
              y=self.data[self.int_col],
              name="Experiment",
              opacity=0.6,
          )
  
          if "Peaks" in self.line_lists:
              ulines = self.line_lists["Peaks"].get_ulines()
              labels = list(range(len(ulines)))
              amplitudes = np.array([uline.intensity for uline in ulines])
              centers = np.array([uline.frequency for uline in ulines])
              # Add sticks for U-lines
              fig.add_bar(
                  x=centers, y=amplitudes, hoverinfo="text", text=labels, name="Peaks"
              )
  
              if simulate is True:
                  widths = units.dop2freq(self.session.doppler, centers)
  
                  simulated = self.simulate_spectrum(
                      self.data[self.freq_col].values,
                      centers,
                      widths,
                      amplitudes,
                      fake=True,
                  )
  
                  self.simulated = pd.DataFrame(
                      data=list(zip(self.data[self.freq_col].values, simulated)),
                      columns=["Frequency", "Intensity"],
                  )
  
                  fig.add_scattergl(
                      x=self.simulated["Frequency"],
                      y=self.simulated["Intensity"],
                      name="Simulated spectrum",
                  )
  
          return fig
code_tokens: def plot_spectrum ( self , simulate = False ) : fig = go . FigureWidget ( ) fig . layout [ "xaxis" ] [ "title" ] = "Frequency (MHz)" fig . layout [ "xaxis" ] [ "tickformat" ] = ".," fig . layout [ "yaxis" ] [ "title" ] = str ( self . int_col ) fig . add_scattergl ( x = self . data [ self . freq_col ] , y = self . data [ self . int_col ] , name = "Experiment" , opacity = 0.6 , ) if "Peaks" in self . line_lists : ulines = self . line_lists [ "Peaks" ] . get_ulines ( ) labels = list ( range ( len ( ulines ) ) ) amplitudes = np . array ( [ uline . intensity for uline in ulines ] ) centers = np . array ( [ uline . frequency for uline in ulines ] ) fig . add_bar ( x = centers , y = amplitudes , hoverinfo = "text" , text = labels , name = "Peaks" ) if simulate is True : widths = units . dop2freq ( self . session . doppler , centers ) simulated = self . simulate_spectrum ( self . data [ self . freq_col ] . values , centers , widths , amplitudes , fake = True , ) self . simulated = pd . DataFrame ( data = list ( zip ( self . data [ self . freq_col ] . values , simulated ) ) , columns = [ "Frequency" , "Intensity" ] , ) fig . add_scattergl ( x = self . simulated [ "Frequency" ] , y = self . simulated [ "Intensity" ] , name = "Simulated spectrum" , ) return fig
short_docstring: Generates a Plotly figure of the spectrum.
short_docstring_tokens: Generates a Plotly figure of the spectrum .
comment: """
              Generates a Plotly figure of the spectrum. If U-lines are
              present, it will plot the simulated spectrum also.
          """$SEP$# Add sticks for U-lines