# Plot graphs with errors

**URL:** <https://root-forum.cern.ch/t/plot-graphs-with-errors/33722>\
**Category:** Newbie\
**Created:** [April 23, 2019, 7:16am UTC](https://root-forum.cern.ch/t/plot-graphs-with-errors/33722 "2019-04-23T07:16:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thabo\_Lepota](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@Thabo\_Lepota](https://root-forum.cern.ch/u/Thabo_Lepota)\
**Post date:** [April 23, 2019, 7:16am UTC](https://root-forum.cern.ch/t/plot-graphs-with-errors/33722/1 "2019-04-23T07:16:46Z")

</div>

Dear all

I want to plot multiple plots with errors in one canvas, i wanna read in the errors and data from a txt file.  
How can i do that ? kindly find the attached text file, the columns unnamed are the errors

Thank you[Run\_20-26.txt](https://root-forum.cern.ch/uploads/default/original/3X/c/0/c0cb4b3e53ae0a7a7c8a73da1d11651311b4e095.txt) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 23, 2019, 8:10am UTC](https://root-forum.cern.ch/t/plot-graphs-with-errors/33722/2 "2019-04-23T08:10:53Z")

</div>

Hi,

You can create a TGraphErrors directly from a text file, see  
[https://root.cern.ch/doc/master/classTGraphErrors.html#a5f6ab98471c9e48337cbbedbbfad07e1](https://root.cern.ch/doc/master/classTGraphErrors.html#a5f6ab98471c9e48337cbbedbbfad07e1)

or just write a small program (in C++ or Python) reading your text file and filling the TGraphErrors

Lorenzo
