How to draw Graph from vector of string

Dear experts,

I have a simple question in root. I have .csv file where data stored. I have one column is date in a formate such as “5/24/2019” and another column I with double.
Now I read this file and store all the values in corresponding vectors.
I stored the date column in vector of strings.
Now I want to draw the date in X-axis and the variable I in y axis.
I tried to use Graph

TGraph *g_Date_I_TOT = new TGraph(I.size(), &V_Date[0] , &I[0]);

but the problem that the only supported data type for the graph is double or float.
I tried to use a function to convert string to double but it take the first number of the date only like 5.

How can I read the date from the txt file and draw in the x-axis?

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Check here. TGraph is at the bottom, but try to read all :slight_smile:

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