How do I print specific data points?

I have this command in my code:

 av41->Print();

and this gives out:

x[0]=6.23438e-06, y[0]=1.79687
x[1]=0.00249998, y[1]=0.00423207
x[2]=0.00499373, y[2]=0.00209039
x[3]=0.00748748, y[3]=0.00138589
x[4]=0.00998123, y[4]=0.00103728
x[5]=0.012475, y[5]=0.000829897
x[6]=0.0149687, y[6]=0.000692643
x[7]=0.0174625, y[7]=0.000595217
x[8]=0.0199562, y[8]=0.000522547
x[9]=0.02245, y[9]=0.000466296
x[10]=0.0249437, y[10]=0.000421486
x[11]=0.0274375, y[11]=0.000384961
x[12]=0.0299312, y[12]=0.000354623
x[13]=0.032425, y[13]=0.000329028
x[14]=0.0349187, y[14]=0.000307146
x[15]=0.0374125, y[15]=0.000288225
x[16]=0.0399062, y[16]=0.000271702
x[17]=0.0424, y[17]=0.000257147
x[18]=0.0448937, y[18]=0.000244229
x[19]=0.0473875, y[19]=0.000232686
x[20]=0.0498812, y[20]=0.000222308
x[21]=0.052375, y[21]=0.000212926
x[22]=0.0548687, y[22]=0.000204403
x[23]=0.0573625, y[23]=0.000196625
x[24]=0.0598562, y[24]=0.000189498
x[25]=0.06235, y[25]=0.000182942
x[26]=0.0648437, y[26]=0.000176891
x[27]=0.0673375, y[27]=0.000171288
x[28]=0.0698312, y[28]=0.000166084
x[29]=0.072325, y[29]=0.000161238
x[30]=0.0748187, y[30]=0.000156712
x[31]=0.0773125, y[31]=0.000152477
x[32]=0.0798062, y[32]=0.000148504
x[33]=0.0823, y[33]=0.000144769
x[34]=0.0847937, y[34]=0.000141251
x[35]=0.0872875, y[35]=0.000137931
x[36]=0.0897812, y[36]=0.000134792
x[37]=0.092275, y[37]=0.00013182
x[38]=0.0947687, y[38]=0.000129001
x[39]=0.0972625, y[39]=0.000126323
x[40]=0.0997562, y[40]=0.000123777
x[41]=0.10225, y[41]=0.000121351
x[42]=0.104744, y[42]=0.000119037
x[43]=0.107237, y[43]=0.000116828
x[44]=0.109731, y[44]=0.000114716
x[45]=0.112225, y[45]=0.000112695
x[46]=0.114719, y[46]=0.000110759
x[47]=0.117212, y[47]=0.000108902
x[48]=0.119706, y[48]=0.00010712
x[49]=0.1222, y[49]=0.000105407
x[50]=0.124694, y[50]=0.00010376
x[51]=0.127187, y[51]=0.000102174
x[52]=0.129681, y[52]=0.000100647
x[53]=0.132175, y[53]=9.91743e-05
x[54]=0.134669, y[54]=9.77536e-05
x[55]=0.137162, y[55]=9.63819e-05
x[56]=0.139656, y[56]=9.50565e-05
x[57]=0.14215, y[57]=9.37751e-05
x[58]=0.144644, y[58]=9.25353e-05
x[59]=0.147137, y[59]=9.1335e-05
x[60]=0.149631, y[60]=9.01723e-05
x[61]=0.152125, y[61]=8.90453e-05
x[62]=0.154619, y[62]=8.79524e-05
x[63]=0.157112, y[63]=8.68918e-05
x[64]=0.159606, y[64]=8.58621e-05
x[65]=0.1621, y[65]=8.48619e-05
x[66]=0.164594, y[66]=8.38898e-05
x[67]=0.167087, y[67]=8.29446e-05
x[68]=0.169581, y[68]=8.20251e-05
x[69]=0.172075, y[69]=8.11303e-05
x[70]=0.174569, y[70]=8.0259e-05
x[71]=0.177062, y[71]=7.94102e-05
x[72]=0.179556, y[72]=7.85832e-05
x[73]=0.18205, y[73]=7.77769e-05
x[74]=0.184544, y[74]=7.69905e-05
x[75]=0.187037, y[75]=7.62233e-05
x[76]=0.189531, y[76]=7.54745e-05
x[77]=0.192025, y[77]=7.47434e-05
x[78]=0.194519, y[78]=7.40293e-05
x[79]=0.197012, y[79]=7.33316e-05
x[80]=0.199506, y[80]=7.26498e-05
x[81]=0.202, y[81]=7.19831e-05
x[82]=0.204494, y[82]=7.13312e-05
x[83]=0.206987, y[83]=7.06933e-05
x[84]=0.209481, y[84]=7.00692e-05
x[85]=0.211975, y[85]=6.94582e-05
x[86]=0.214469, y[86]=6.886e-05
x[87]=0.216962, y[87]=6.82741e-05
x[88]=0.219456, y[88]=6.77e-05
x[89]=0.22195, y[89]=6.71375e-05
x[90]=0.224444, y[90]=6.65862e-05
x[91]=0.226937, y[91]=6.60456e-05
x[92]=0.229431, y[92]=6.55154e-05
x[93]=0.231925, y[93]=6.49954e-05
x[94]=0.234419, y[94]=6.44851e-05
x[95]=0.236912, y[95]=6.39844e-05
x[96]=0.239406, y[96]=6.34929e-05
x[97]=0.2419, y[97]=6.30103e-05
x[98]=0.244394, y[98]=6.25363e-05
x[99]=0.246887, y[99]=6.20708e-05
x[100]=0.249381, y[100]=6.16135e-05
x[101]=0.251875, y[101]=6.11641e-05
x[102]=0.254369, y[102]=6.07224e-05
x[103]=0.256862, y[103]=6.02882e-05
x[104]=0.259356, y[104]=5.98613e-05
x[105]=0.26185, y[105]=5.94415e-05
x[106]=0.264344, y[106]=5.90286e-05
x[107]=0.266837, y[107]=5.86224e-05
x[108]=0.269331, y[108]=5.82227e-05
x[109]=0.271825, y[109]=5.78294e-05
x[110]=0.274319, y[110]=5.74422e-05
x[111]=0.276812, y[111]=5.70612e-05
x[112]=0.279306, y[112]=5.66859e-05
x[113]=0.2818, y[113]=5.63165e-05
x[114]=0.284294, y[114]=5.59526e-05
x[115]=0.286787, y[115]=5.55941e-05
x[116]=0.289281, y[116]=5.5241e-05
x[117]=0.291775, y[117]=5.4893e-05
x[118]=0.294269, y[118]=5.45501e-05
x[119]=0.296762, y[119]=5.42121e-05
x[120]=0.299256, y[120]=5.3879e-05
x[121]=0.30175, y[121]=5.35505e-05
x[122]=0.304244, y[122]=5.32267e-05
x[123]=0.306737, y[123]=5.29073e-05
x[124]=0.309231, y[124]=5.25924e-05
x[125]=0.311725, y[125]=5.22817e-05
x[126]=0.314219, y[126]=5.19752e-05
x[127]=0.316712, y[127]=5.16728e-05
x[128]=0.319206, y[128]=5.13744e-05
x[129]=0.3217, y[129]=5.10799e-05
x[130]=0.324194, y[130]=5.07893e-05
x[131]=0.326687, y[131]=5.05024e-05
x[132]=0.329181, y[132]=5.02192e-05
x[133]=0.331675, y[133]=4.99396e-05
x[134]=0.334169, y[134]=4.96635e-05
x[135]=0.336662, y[135]=4.93908e-05
x[136]=0.339156, y[136]=4.91216e-05
x[137]=0.34165, y[137]=4.88556e-05
x[138]=0.344144, y[138]=4.85928e-05
x[139]=0.346637, y[139]=4.83333e-05
x[140]=0.349131, y[140]=4.80768e-05
x[141]=0.351625, y[141]=4.78234e-05
x[142]=0.354119, y[142]=4.75729e-05
x[143]=0.356612, y[143]=4.73254e-05
x[144]=0.359106, y[144]=4.70808e-05
x[145]=0.3616, y[145]=4.6839e-05
x[146]=0.364094, y[146]=4.65999e-05
x[147]=0.366587, y[147]=4.63636e-05
x[148]=0.369081, y[148]=4.61299e-05
x[149]=0.371575, y[149]=4.58988e-05
x[150]=0.374069, y[150]=4.56703e-05
x[151]=0.376562, y[151]=4.54443e-05
x[152]=0.379056, y[152]=4.52207e-05
x[153]=0.38155, y[153]=4.49996e-05
x[154]=0.384044, y[154]=4.47809e-05
x[155]=0.386537, y[155]=4.45645e-05
x[156]=0.389031, y[156]=4.43504e-05
x[157]=0.391525, y[157]=4.41385e-05
x[158]=0.394019, y[158]=4.39289e-05
x[159]=0.396512, y[159]=4.37214e-05
x[160]=0.399006, y[160]=4.35161e-05
x[161]=0.4015, y[161]=4.33129e-05
x[162]=0.403994, y[162]=4.31117e-05
x[163]=0.406487, y[163]=4.29126e-05
x[164]=0.408981, y[164]=4.27155e-05
x[165]=0.411475, y[165]=4.25203e-05
x[166]=0.413969, y[166]=4.23271e-05
x[167]=0.416462, y[167]=4.21357e-05
x[168]=0.418956, y[168]=4.19463e-05
x[169]=0.42145, y[169]=4.17587e-05
x[170]=0.423944, y[170]=4.15728e-05
x[171]=0.426437, y[171]=4.13888e-05
x[172]=0.428931, y[172]=4.12065e-05
x[173]=0.431425, y[173]=4.1026e-05
x[174]=0.433919, y[174]=4.08471e-05
x[175]=0.436412, y[175]=4.06699e-05
x[176]=0.438906, y[176]=4.04944e-05
x[177]=0.4414, y[177]=4.03204e-05
x[178]=0.443894, y[178]=4.01481e-05
x[179]=0.446387, y[179]=3.99773e-05
x[180]=0.448881, y[180]=3.98081e-05
x[181]=0.451375, y[181]=3.96404e-05
x[182]=0.453869, y[182]=3.94742e-05
x[183]=0.456362, y[183]=3.93095e-05
x[184]=0.458856, y[184]=3.91463e-05
x[185]=0.46135, y[185]=3.89844e-05
x[186]=0.463844, y[186]=3.8824e-05
x[187]=0.466337, y[187]=3.8665e-05
x[188]=0.468831, y[188]=3.85074e-05
x[189]=0.471325, y[189]=3.83511e-05
x[190]=0.473819, y[190]=3.81961e-05
x[191]=0.476312, y[191]=3.80425e-05
x[192]=0.478806, y[192]=3.78901e-05
x[193]=0.4813, y[193]=3.7739e-05
x[194]=0.483794, y[194]=3.75892e-05
x[195]=0.486287, y[195]=3.74407e-05
x[196]=0.488781, y[196]=3.72933e-05
x[197]=0.491275, y[197]=3.71472e-05
x[198]=0.493769, y[198]=3.70023e-05
x[199]=0.496262, y[199]=3.68585e-05
x[200]=0.498756, y[200]=3.67159e-05
x[201]=0.50125, y[201]=3.65745e-05
x[202]=0.503744, y[202]=3.64342e-05
x[203]=0.506237, y[203]=3.6295e-05
x[204]=0.508731, y[204]=3.61568e-05
x[205]=0.511225, y[205]=3.60198e-05
x[206]=0.513719, y[206]=3.58839e-05
x[207]=0.516212, y[207]=3.5749e-05
x[208]=0.518706, y[208]=3.56152e-05
x[209]=0.5212, y[209]=3.54823e-05
x[210]=0.523694, y[210]=3.53506e-05
x[211]=0.526187, y[211]=3.52198e-05
x[212]=0.528681, y[212]=3.509e-05
x[213]=0.531175, y[213]=3.49612e-05
x[214]=0.533669, y[214]=3.48333e-05
x[215]=0.536162, y[215]=3.47064e-05
x[216]=0.538656, y[216]=3.45805e-05
x[217]=0.54115, y[217]=3.44555e-05
x[218]=0.543644, y[218]=3.43314e-05
x[219]=0.546137, y[219]=3.42082e-05
x[220]=0.548631, y[220]=3.40859e-05
x[221]=0.551125, y[221]=3.39645e-05
x[222]=0.553619, y[222]=3.3844e-05
x[223]=0.556112, y[223]=3.37244e-05
x[224]=0.558606, y[224]=3.36056e-05
x[225]=0.5611, y[225]=3.34876e-05
x[226]=0.563594, y[226]=3.33705e-05
x[227]=0.566087, y[227]=3.32542e-05
x[228]=0.568581, y[228]=3.31388e-05
x[229]=0.571075, y[229]=3.30241e-05
x[230]=0.573569, y[230]=3.29103e-05
x[231]=0.576062, y[231]=3.27972e-05
x[232]=0.578556, y[232]=3.26849e-05
x[233]=0.58105, y[233]=3.25734e-05
x[234]=0.583544, y[234]=3.24626e-05
x[235]=0.586037, y[235]=3.23526e-05
x[236]=0.588531, y[236]=3.22434e-05
x[237]=0.591025, y[237]=3.21349e-05
x[238]=0.593519, y[238]=3.20271e-05
x[239]=0.596012, y[239]=3.192e-05
x[240]=0.598506, y[240]=3.18137e-05
x[241]=0.601, y[241]=3.1708e-05
x[242]=0.603494, y[242]=3.16031e-05
x[243]=0.605987, y[243]=3.14988e-05
x[244]=0.608481, y[244]=3.13953e-05
x[245]=0.610975, y[245]=3.12924e-05
x[246]=0.613469, y[246]=3.11902e-05
x[247]=0.615962, y[247]=3.10886e-05
x[248]=0.618456, y[248]=3.09877e-05
x[249]=0.62095, y[249]=3.08874e-05
x[250]=0.623444, y[250]=3.07878e-05
x[251]=0.625937, y[251]=3.06888e-05
x[252]=0.628431, y[252]=3.05905e-05
x[253]=0.630925, y[253]=3.04927e-05
x[254]=0.633419, y[254]=3.03956e-05
x[255]=0.635912, y[255]=3.02991e-05
x[256]=0.638406, y[256]=3.02032e-05
x[257]=0.6409, y[257]=3.01078e-05
x[258]=0.643394, y[258]=3.00131e-05
x[259]=0.645887, y[259]=2.9919e-05
x[260]=0.648381, y[260]=2.98254e-05
x[261]=0.650875, y[261]=2.97324e-05
x[262]=0.653369, y[262]=2.964e-05
x[263]=0.655862, y[263]=2.95481e-05
x[264]=0.658356, y[264]=2.94568e-05
x[265]=0.66085, y[265]=2.9366e-05
x[266]=0.663344, y[266]=2.92758e-05
x[267]=0.665837, y[267]=2.91862e-05
x[268]=0.668331, y[268]=2.9097e-05
x[269]=0.670825, y[269]=2.90084e-05
x[270]=0.673319, y[270]=2.89203e-05
x[271]=0.675812, y[271]=2.88327e-05
x[272]=0.678306, y[272]=2.87457e-05
x[273]=0.6808, y[273]=2.86591e-05
x[274]=0.683294, y[274]=2.85731e-05
x[275]=0.685787, y[275]=2.84876e-05
x[276]=0.688281, y[276]=2.84025e-05
x[277]=0.690775, y[277]=2.83179e-05
x[278]=0.693269, y[278]=2.82339e-05
x[279]=0.695762, y[279]=2.81503e-05
x[280]=0.698256, y[280]=2.80672e-05
x[281]=0.70075, y[281]=2.79845e-05
x[282]=0.703244, y[282]=2.79023e-05
x[283]=0.705737, y[283]=2.78206e-05
x[284]=0.708231, y[284]=2.77394e-05
x[285]=0.710725, y[285]=2.76586e-05
x[286]=0.713219, y[286]=2.75782e-05
x[287]=0.715712, y[287]=2.74983e-05
x[288]=0.718206, y[288]=2.74189e-05
x[289]=0.7207, y[289]=2.73399e-05
x[290]=0.723194, y[290]=2.72613e-05
x[291]=0.725687, y[291]=2.71831e-05
x[292]=0.728181, y[292]=2.71054e-05
x[293]=0.730675, y[293]=2.70281e-05
x[294]=0.733169, y[294]=2.69512e-05
x[295]=0.735662, y[295]=2.68747e-05
x[296]=0.738156, y[296]=2.67987e-05
x[297]=0.74065, y[297]=2.67231e-05
x[298]=0.743144, y[298]=2.66478e-05
x[299]=0.745637, y[299]=2.6573e-05
x[300]=0.748131, y[300]=2.64985e-05
x[301]=0.750625, y[301]=2.64245e-05
x[302]=0.753119, y[302]=2.63508e-05
x[303]=0.755612, y[303]=2.62776e-05
x[304]=0.758106, y[304]=2.62047e-05
x[305]=0.7606, y[305]=2.61322e-05
x[306]=0.763094, y[306]=2.60601e-05
x[307]=0.765587, y[307]=2.59884e-05
x[308]=0.768081, y[308]=2.5917e-05
x[309]=0.770575, y[309]=2.5846e-05
x[310]=0.773069, y[310]=2.57754e-05
x[311]=0.775562, y[311]=2.57051e-05
x[312]=0.778056, y[312]=2.56352e-05
x[313]=0.78055, y[313]=2.55656e-05
x[314]=0.783044, y[314]=2.54964e-05
x[315]=0.785537, y[315]=2.54276e-05
x[316]=0.788031, y[316]=2.53591e-05
x[317]=0.790525, y[317]=2.52909e-05
x[318]=0.793019, y[318]=2.52231e-05
x[319]=0.795512, y[319]=2.51556e-05
x[320]=0.798006, y[320]=2.50885e-05
x[321]=0.8005, y[321]=2.50217e-05
x[322]=0.802994, y[322]=2.49553e-05
x[323]=0.805487, y[323]=2.48891e-05
x[324]=0.807981, y[324]=2.48233e-05
x[325]=0.810475, y[325]=2.47578e-05
x[326]=0.812969, y[326]=2.46927e-05
x[327]=0.815462, y[327]=2.46278e-05
x[328]=0.817956, y[328]=2.45633e-05
x[329]=0.82045, y[329]=2.44991e-05
x[330]=0.822944, y[330]=2.44352e-05
x[331]=0.825437, y[331]=2.43716e-05
x[332]=0.827931, y[332]=2.43083e-05
x[333]=0.830425, y[333]=2.42453e-05
x[334]=0.832919, y[334]=2.41826e-05
x[335]=0.835412, y[335]=2.41203e-05
x[336]=0.837906, y[336]=2.40582e-05
x[337]=0.8404, y[337]=2.39964e-05
x[338]=0.842894, y[338]=2.39349e-05
x[339]=0.845387, y[339]=2.38737e-05
x[340]=0.847881, y[340]=2.38128e-05
x[341]=0.850375, y[341]=2.37522e-05
x[342]=0.852869, y[342]=2.36918e-05
x[343]=0.855362, y[343]=2.36318e-05
x[344]=0.857856, y[344]=2.3572e-05
x[345]=0.86035, y[345]=2.35125e-05
x[346]=0.862844, y[346]=2.34533e-05
x[347]=0.865337, y[347]=2.33944e-05
x[348]=0.867831, y[348]=2.33357e-05
x[349]=0.870325, y[349]=2.32773e-05
x[350]=0.872819, y[350]=2.32191e-05
x[351]=0.875312, y[351]=2.31613e-05
x[352]=0.877806, y[352]=2.31037e-05
x[353]=0.8803, y[353]=2.30463e-05
x[354]=0.882794, y[354]=2.29892e-05
x[355]=0.885287, y[355]=2.29324e-05
x[356]=0.887781, y[356]=2.28758e-05
x[357]=0.890275, y[357]=2.28195e-05
x[358]=0.892769, y[358]=2.27635e-05
x[359]=0.895262, y[359]=2.27077e-05
x[360]=0.897756, y[360]=2.26521e-05
x[361]=0.90025, y[361]=2.25968e-05
x[362]=0.902744, y[362]=2.25417e-05
x[363]=0.905237, y[363]=2.24869e-05
x[364]=0.907731, y[364]=2.24323e-05
x[365]=0.910225, y[365]=2.2378e-05
x[366]=0.912719, y[366]=2.23239e-05
x[367]=0.915212, y[367]=2.22701e-05
x[368]=0.917706, y[368]=2.22164e-05
x[369]=0.9202, y[369]=2.2163e-05
x[370]=0.922694, y[370]=2.21099e-05
x[371]=0.925187, y[371]=2.2057e-05
x[372]=0.927681, y[372]=2.20043e-05
x[373]=0.930175, y[373]=2.19518e-05
x[374]=0.932669, y[374]=2.18996e-05
x[375]=0.935162, y[375]=2.18476e-05
x[376]=0.937656, y[376]=2.17958e-05
x[377]=0.94015, y[377]=2.17442e-05
x[378]=0.942644, y[378]=2.16929e-05
x[379]=0.945137, y[379]=2.16417e-05
x[380]=0.947631, y[380]=2.15908e-05
x[381]=0.950125, y[381]=2.15401e-05
x[382]=0.952619, y[382]=2.14896e-05
x[383]=0.955112, y[383]=2.14394e-05
x[384]=0.957606, y[384]=2.13893e-05
x[385]=0.9601, y[385]=2.13395e-05
x[386]=0.962594, y[386]=2.12898e-05
x[387]=0.965087, y[387]=2.12404e-05
x[388]=0.967581, y[388]=2.11912e-05
x[389]=0.970075, y[389]=2.11422e-05
x[390]=0.972569, y[390]=2.10934e-05
x[391]=0.975062, y[391]=2.10447e-05
x[392]=0.977556, y[392]=2.09963e-05
x[393]=0.98005, y[393]=2.09481e-05
x[394]=0.982544, y[394]=2.09001e-05
x[395]=0.985037, y[395]=2.08523e-05
x[396]=0.987531, y[396]=2.08047e-05
x[397]=0.990025, y[397]=2.07573e-05
x[398]=0.992519, y[398]=2.071e-05
x[399]=0.995012, y[399]=2.0663e-05

what if I only wanted to print out
x[0]=, y[0]=
x[5]=, y[5]=
x[10]=, y[10]=
x[15]=, y[15]=
x[20]=, y[20]=
x[25]=, y[25]=
x[30]=, y[30]=
.
.
.
x[395]=, y[395]=
how do I do it?

best regards,
jaybee

Loop over the TGraph points (i=0 to i<400) and use
https://root.cern.ch/root/html534/TGraph.html#TGraph:GetPoint
with i=0, 5, 10, etc., to print the values you want.

should it look like this?

TGraph *av55 = new TGraph();
for (Int_t j=0; j < 400; j++)
 {
  xpt = del*j + 0.0025*del;
  av55->SetPoint(j, xpt, 0.0);
 }
 for (Int_t i=0; i<nof; i++)
 {
  for (Int_t j=0; j < nop; j++)
  {
   av55->GetPoint(j, xpt, ypt);
   av55->SetPoint(j, xpt, ypt + lec[i]->Eval(xpt)/(Double_t)nof);
  }
 }
av55->GetPoint(0, x, y);
av55->GetPoint(5, x, y);
.
.
.
av55->GetPoint(395, x, y);

or should it be like this

 av55->GetPoint(i, xpt[i], ypt[i]); 
 cout<<"0"<<"="<<xpt[0]<<","<<ypt[0]<<endl;
 cout<<"5"<<"="<<xpt[5]<<","<<ypt[5]<<endl;
 cout<<"10"<<"="<<xpt[10]<<","<<ypt[10]<<endl;
.
.
.
cout<<"395"<<"="<<xpt[10]<<","<<ypt[10]<<endl;

Try this (I did not, so make sure there aren’t any obvious mistakes first):

TGraph *av55 = new TGraph();
for (Int_t j=0; j < 400; j++)
{
    xpt = del*j + 0.0025*del;
    av55->SetPoint(j, xpt, 0.0);
    if (j%5 == 0) // if point number is a multiple of 5
        printf("x[%i]=%f, y[%i]=%f\n", j, xpt, j, 0.0); // since all y values are zeroes anyway
}

the x-values have corresponding y-values on my function and the point number is not necessarily a multiple of 5 (sorry for misleading example).

Okay, if it’s not a multiple of 5, what’s the exact criterion to print the values then?

gracias for helping…
well, it depends on the experimental data that I compare my outcome.
so, like if the experimental data has points on x[0], x[5], x[11], x[17], x[22]… i have to get the corresponding y-value of the same x-values from my numerical calculation… :slight_smile:

So if it’s gonna be 0, 5, 11, 17, 22,… , it’s difficult to automate the printing. You’ll have to do it manually:

TGraph *av55 = new TGraph();
for (Int_t j=0; j < 400; j++)
{
    xpt = del*j + 0.0025*del;
    av55->SetPoint(j, xpt, 0.0);
}
Double_t x, y;
av55->GetPoint(0, x, y); printf("x[0]=%f, y[0]=%f\n", x, y);
av55->GetPoint(5, x, y); printf("x[5]=%f, y[5]=%f\n", x, y);
av55->GetPoint(11, x, y); printf("x[11]=%f, y[11]=%f\n", x, y);
av55->GetPoint(17, x, y); printf("x[17]=%f, y[17]=%f\n", x, y);
av55->GetPoint(22, x, y); printf("x[22]=%f, y[22]=%f\n", x, y);
/* and so on if needed */

It can be made a bit more general:

{

   int indices[] = {0, 5, 11, 17, 22};

   double xpt, del = 0.1;
   TGraph *av55 = new TGraph();

   for (Int_t j=0; j < 400; j++) {
      xpt = del*j + 0.0025*del;
      av55->SetPoint(j, xpt, 0.0);
   }

   Double_t x, y;
   for (const int& i : indices) {
      av55->GetPoint(i, x, y); printf("x[%d]=%f, y[%d]=%f\n", i, x, y);
   }
}

just add, remove or change a value in indices and the rest of the code will work
without changes

muchas gracias for these, guys :slight_smile: