i want to draw [color=blue]8 type data with different color and marker in the same picture[/color],using a loop,but i find only the first data with different color and marker.
{
TCanvas *c1 = new TCanvas(“c1”, “c1”,80,80,500,500);
FILE *fp=fopen(“data.dat”,“r”);
TFile *f=new TFile(“data.root”,“RECREATE”);
TTree *t=new TTree(“T”,“data from ascii file”);
Float_t x[8][3];
t.Branch(“x”,x,“x[8][3]/F”);
UShort_t i,j,r;
for(r=0;r<2000;r++)
{
for(i=0;i<8;i++)
{
for(j=0;j<3;j++)
{
fscanf(fp,"%f",&x[i][j]);
// printf("%.3f “,x[i][j]);
}
}
// printf(”\n");
t->Fill();
}
for(i=0;i<8;i++)
{
if(i==0) t->Draw(“x[0][1]:x[0][2]:x[0][0]”,"","");
if(i!=0) t->Draw(Form(“x[%d][1]:x[%d][2]:x[%d][0]”,i,i,i),"",“same”);
pmarker3D = new TPolyMarker3D(2000,2,"");
pmarker3D->SetName("TPolyMarker3D");
TPolyMarker3D->SetMarkerColor(i);
TPolyMarker3D->SetMarkerStyle(i);
c1->Print(Form("%d.gif",i));
}
c1->Print(“3d.gif”);
}
0.1 0.007936 3 0.1 0.007935 4 0.1 0.009266 5 0.1 0.01216 6 0.1 0.02552 7 0.1 0.0351 8 0.1 0.03492 9 0.1 0.06326 10
0.2 0.008255 3 0.2 0.008108 4 0.2 0.009433 5 0.2 0.01234 6 0.2 0.02572 7 0.2 0.03533 8 0.2 0.0352 9 0.2 0.06357 10
0.3 0.02014 3 0.3 0.01697 4 0.3 0.01949 5 0.3 0.02493 6 0.3 0.04162 7 0.3 0.05558 8 0.3 0.06133 9 0.3 0.09475 10
0.4 0.0815 3 0.4 0.0766 4 0.4 0.09501 5 0.4 0.1247 6 0.4 0.1693 7 0.4 0.2159 8 0.4 0.2598 9 0.4 0.3196 10
0.5 0.2106 3 0.5 0.2237 4 0.5 0.2824 5 0.5 0.3565 6 0.5 0.4363 7 0.5 0.5083 8 0.5 0.5686 9 0.5 0.6224 10
0.6 0.3797 3 0.6 0.4258 4 0.6 0.5167 5 0.6 0.606 6 0.6 0.6806 7 0.6 0.736 8 0.6 0.7758 9 0.6 0.8048 10
0.7 0.5537 3 0.7 0.6264 4 0.7 0.7222 5 0.7 0.7979 6 0.7 0.8502 7 0.7 0.8841 8 0.7 0.9057 9 0.7 0.92 10
0.8 0.715 3 0.8 0.8009 4 0.8 0.8857 5 0.8 0.9418 6 0.8 0.9756 7 0.8 0.9953 8 0.8 1.007 9 0.8 1.014 10
0.9 0.8607 3 0.9 0.9497 4 0.9 1.019 5 0.9 1.059 6 0.9 1.081 7 0.9 1.093 8 0.9 1.099 9 0.9 1.103 10
1 0.993 3 1 1.08 4 1 1.136 5 1 1.164 6 1 1.178 7 1 1.185 8 1 1.189 9 1 1.191 10
1.1 1.116 3 1.1 1.197 4 1.1 1.242 5 1.1 1.263 6 1.1 1.272 7 1.1 1.276 8 1.1 1.279 9 1.1 1.28 10
1.2 1.231 3 1.2 1.307 4 1.2 1.343 5 1.2 1.358 6 1.2 1.365 7 1.2 1.368 8 1.2 1.369 9 1.2 1.37 10
1.3 1.342 3 1.3 1.412 4 1.3 1.442 5 1.3 1.453 6 1.3 1.457 7 1.3 1.459 8 1.3 1.46 9 1.3 1.461 10
1.4 1.449 3 1.4 1.514 4 1.4 1.538 5 1.4 1.547 6 1.4 1.55 7 1.4 1.551 8 1.4 1.552 9 1.4 1.553 10
1.5 1.554 3 1.5 1.614 4 1.5 1.634 5 1.5 1.641 6 1.5 1.643 7 1.5 1.644 8 1.5 1.645 9 1.5 1.645 10
1.6 1.657 3 1.6 1.713 4 1.6 1.73 5 1.6 1.735 6 1.6 1.737 7 1.6 1.738 8 1.6 1.738 9 1.6 1.738 10
1.7 1.759 3 1.7 1.811 4 1.7 1.825 5 1.7 1.829 6 1.7 1.831 7 1.7 1.831 8 1.7 1.832 9 1.7 1.832 10
1.8 1.86 3 1.8 1.909 4 1.8 1.921 5 1.8 1.924 6 1.8 1.925 7 1.8 1.926 8 1.8 1.926 9 1.8 1.926 10
1.9 1.96 3 1.9 2.006 4 1.9 2.017 5 1.9 2.019 6 1.9 2.02 7 1.9 2.02 8 1.9 2.021 9 1.9 2.021 10
2 2.06 3 2 2.103 4 2 2.112 5 2 2.115 6 2 2.115 7 2 2.116 8 2 2.116 9 2 2.116 10