# Problem in ploting keff

**URL:** https://openmc.discourse.group/t/problem-in-ploting-keff/1033
**Category:** User Support
**Created:** [February 25, 2021, 12:59pm UTC](https://openmc.discourse.group/t/problem-in-ploting-keff/1033 "2021-02-25T12:59:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SaitoAsuka](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@SaitoAsuka](https://openmc.discourse.group/u/SaitoAsuka)
#### Post date: [February 25, 2021, 12:59pm UTC](https://openmc.discourse.group/t/problem-in-ploting-keff/1033/1 "2021-02-25T12:59:04Z")

</div>

Hi,

I used the code in an example to plot keff, where the curve above is correct and I want, but why does the curve below appear? The code is as following.

> results = openmc.deplete.ResultsList.from\_hdf5(“./depletion\_results.h5”)  
> time, k = results.get\_eigenvalue()  
> days = 24_60_60  
> plt.plot(time/days, k, label=“K-effective”)  
> plt.xlabel(“Time (days)”)  
> plt.ylabel(“Keff”)  
> plt.legend()  
> plt.show()

And the picture I get

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/4/4a0311d841ee4a3a74ae347555d3769378b0f232.png)

---

<div class="post-metadata">

### Author: ![andrewjohnson](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@andrewjohnson](https://openmc.discourse.group/u/andrewjohnson)
#### Post date: [February 25, 2021, 2:56pm UTC](https://openmc.discourse.group/t/problem-in-ploting-keff/1033/2 "2021-02-25T14:56:14Z")

</div>

The array returned has two columns: column zero is the expected value, column one is the associated uncertainty. If you just wanted to plot k without uncertainty, run

```python
plt.plot(time / days, k[:, 0], label="K-effective")

```

or, to plot with errorbars

```python
plt.errorbar(time / days, k[:, 0], yerr=k[:, 1], label="K-effective")

```

Edit: add link to docs - [openmc.deplete.ResultsList — OpenMC Documentation](https://docs.openmc.org/en/stable/pythonapi/generated/openmc.deplete.ResultsList.html#openmc.deplete.ResultsList.get_eigenvalue)
