First i’d like to thank you guys for the amazing job done with python in 6.22 : out of the box we have both python 2 & 3 working smoothly with a single installation, numpy arrays are there without problem, ctypes are now the default, and from some very preliminary test, it seems to wokr as well on Windows 10… A lot of things have been done and that’s great.
I’ve been receiving questions from python users wondering whethe you have considered dumping plots in python (as you’re doing in C++). They are newcomers, python fan boy and they use ROOT in interactive to create their plot and would like to have the command in python that correspond to what they’ve done.
Any idea whether this exits ? Is this in the pipe ? do you recommand to dump in C++ to get the general idea ?
When you say dumping a plot, you mean generating the code that can produce that plot, right?
Unfortunately I am not aware of this existing for Python, only C++, @couet can confirm, and there are no plans to implement it. But codewise, there shouldn’t be much difference between the generated C++ code and its equivalent in Python, since it should basically consist in calls to the graphics API of ROOT.
The only thing that should be taken into account when translating is that, in Python, when creating a canvas or any object that is added to a canvas, such objects need to be alive for you to see them in the plot. In other words, if you create an object (e.g. a TText) inside a function, add it to the canvas and then return from the function, that object will not appear anymore in the canvas (since it was garbage collected by Python).