TText in pyroot

ROOT Version: 6.19/01 (v6-19-01-1086-geeceef4579)
Platform: 64 bit Fedora29 (linuxx8664gcc; 5.3.11-100.fc29.x86_64)
Compiler: gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC), Python 2.7.17

Can someone help me to convert the following line of a C-code to pyroot?

TText *t2 = new TText(pPosition[p]-2,pHeight[p]*0.90,Form("%g",pPosition[p]));

I am beginner in python.

Thank you.



I’m sure @etejedor, our PyROOT expert, will help you

You need to do the object creation the Python way, and if pPosition is an array/std::vector in C++, you will probably use it as a list or numpy array in Python.

Hi @etejedor,

I figured it out. Please see the macro in recent post - Displaying and labeling peaks using DynamicSlice

Anyway, thanks for your reply.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.