# tfma.view.render_plot

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/widget_view.py#L87-L118) |

Renders the plot view as widget.

    tfma.view.render_plot(
        result: https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalResult,
        slicing_spec: Optional[Union[slicer.SingleSliceSpec, https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/SlicingSpec]] = None,
        output_name: Optional[str] = None,
        class_id: Optional[int] = None,
        top_k: Optional[int] = None,
        k: Optional[int] = None,
        label: Optional[str] = None
    ) -> Optional[visualization.PlotViewer]

### Used in the notebooks

| Used in the tutorials |
|---|
| - [TensorFlow Model Analysis](https://www.tensorflow.org/tfx/tutorials/model_analysis/tfma_basic) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `result` | An tfma.EvalResult. |
| `slicing_spec` | The tfma.SlicingSpec to identify the slice. Show overall if unset. |
| `output_name` | A string representing the output name. |
| `class_id` | A number representing the class id if multi class. |
| `top_k` | The k used to compute prediction in the top k position. |
| `k` | The k used to compute prediciton at the kth position. |
| `label` | A partial label used to match a set of plots in the results. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A PlotViewer object if in Jupyter notebook; None if in Colab. ||

<br />