# uproot.as_TGraph

Defined in uproot.writing.interpret on line 212.

uproot.writing.interpret.as_TGraph(df, title='', xAxisLabel='', yAxisLabel='', minY=None, maxY=None, lineColor: int = 602, lineStyle: int = 1, lineWidth: int = 1, markerColor: int = 1, markerStyle: int = 1, markerSize: float = 1.0)
  Parameters:

    - df (DataFrame or and dict like object) – DataFrame object with column names as follows: x (float): x values of TGraph. y (float): y values of TGraph. x_errors (float or left unspecified): Symethrical error values for corresponding x value y_errors (float or left unspecified): Symethrical error values for corresponding y value x_errors_low (float or left unspecified): Asymmetrical lower error values for corresponding x value x_errors_high (float or left unspecified): Asymmetrical upper error values for corresponding x value y_errors_low (float or left unspecified): Asymmetrical lower error values for corresponding y value y_errors_high (float or left unspecified): Asymmetrical upper error values for corresponding y value (other column names will be ignored!)

    - title (str) – Title of the histogram.

    - xAxisLabel (str) – Label of the X axis.

    - yAxisLabel (str) – Label of the Y axis.

    - minY (None or float) – Minimum value on the Y axis to be shown, if set to None then minY=min(y)

    - maxY (None or float) – Maximum value on the Y axis to be shown, if set to None then maxY=max(y)

    - lineColor (int) – Line color. (https://root.cern.ch/doc/master/classTAttLine.html)

    - lineStyle (int) – Line style.

    - lineWidth (int) – Line width.

    - markerColor (int) – Marker color. (https://root.cern.ch/doc/master/classTAttMarker.html)

    - markerStyle (int) – Marker style.

    - markerSize (float) – Marker size.

  WARNING! This function only works for TGraph, because serialization of TGraphErrors and TGraphAsymmErrors is not implemented yet.

  Function that converts DataFrame into TGraph, TGraphErrors or TGraphAsymmErros based on the specified DataFrame columns. When all error columns are unspecified, detected object is TGraph. When x_errors, y_errors are specified, detected object is TGraphErrors. When x_errors_low, x_errors_high, y_errors_low, y_errors_high are specified, detected object is TGraphAsymmErrors. Note that both {x_errors, x_errors} need to be specified or set to None. The same rule applies {to x_errors_low, x_errors_high, x_errors_low, x_errors_high}. Also can’t specify {x_errors, y_errors} and {x_errors_low, x_errors_high, y_errors_low, y_errors_high} at the same time.