ROOT logo

From $ROOTSYS/tutorials/graphics/quarks.C

// example illustrating divided pads and Latex
// Author: Rene Brun
void quarks () {
   TCanvas *c1 = new TCanvas("c1", "c1",10,10,630,760);
   c1->SetFillColor(kBlack);
   Int_t quarkColor  = 50;
   Int_t leptonColor = 16;
   Int_t forceColor  = 38;
   Int_t titleColor  = kYellow;
   Int_t border = 8;
   
   TLatex *texf = new TLatex(0.90,0.455,"Force Carriers");
   texf->SetTextColor(forceColor);
   texf->SetTextAlign(22); texf->SetTextSize(0.07); 
   texf->SetTextAngle(90);
   texf->Draw();
   
   TLatex *texl = new TLatex(0.11,0.288,"Leptons");
   texl->SetTextColor(leptonColor);
   texl->SetTextAlign(22); texl->SetTextSize(0.07); 
   texl->SetTextAngle(90);
   texl->Draw();
   
   TLatex *texq = new TLatex(0.11,0.624,"Quarks");
   texq->SetTextColor(quarkColor);
   texq->SetTextAlign(22); texq->SetTextSize(0.07); 
   texq->SetTextAngle(90);
   texq->Draw();
   
   TLatex tex(0.5,0.5,"u");
   tex.SetTextColor(titleColor); tex.SetTextFont(32); 
   tex.SetTextAlign(22);
   tex.SetTextSize(0.14); 
   tex.DrawLatex(0.5,0.93,"Elementary");
   tex.SetTextSize(0.12); 
   tex.DrawLatex(0.5,0.84,"Particles");
   tex.SetTextSize(0.05); 
   tex.DrawLatex(0.5,0.067,"Three Generations of Matter");

   tex.SetTextColor(kBlack); tex.SetTextSize(0.8);
         
// ------------>Create main pad and its subdivisions
   TPad *pad = new TPad("pad", "pad",0.15,0.11,0.85,0.79);
   pad->Draw();
   pad->cd();
   pad->Divide(4,4,0.0003,0.0003);
  
   pad->cd(1); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"u");

   pad->cd(2); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"c");
  
   pad->cd(3); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"t");
  
   pad->cd(4); gPad->SetFillColor(forceColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.55,"#gamma");
  
   pad->cd(5); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"d");
  
   pad->cd(6); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"s");
  
   pad->cd(7); gPad->SetFillColor(quarkColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"b");
  
   pad->cd(8); gPad->SetFillColor(forceColor);   
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.55,"g");
  
   pad->cd(9); gPad->SetFillColor(leptonColor);  
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"#nu_{e}");
  
   pad->cd(10); gPad->SetFillColor(leptonColor); 
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"#nu_{#mu}");
  
   pad->cd(11); gPad->SetFillColor(leptonColor); 
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"#nu_{#tau}");
  
   pad->cd(12); gPad->SetFillColor(forceColor);  
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"Z");
  
   pad->cd(13); gPad->SetFillColor(leptonColor); 
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"e");
  
   pad->cd(14); gPad->SetFillColor(leptonColor); 
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.56,"#mu");
  
   pad->cd(15); gPad->SetFillColor(leptonColor); 
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"#tau");
  
   pad->cd(16); gPad->SetFillColor(forceColor);  
   gPad->SetBorderSize(border);
   tex.DrawLatex(.5,.5,"W");
  
   c1->cd();
}
 quarks.C:1
 quarks.C:2
 quarks.C:3
 quarks.C:4
 quarks.C:5
 quarks.C:6
 quarks.C:7
 quarks.C:8
 quarks.C:9
 quarks.C:10
 quarks.C:11
 quarks.C:12
 quarks.C:13
 quarks.C:14
 quarks.C:15
 quarks.C:16
 quarks.C:17
 quarks.C:18
 quarks.C:19
 quarks.C:20
 quarks.C:21
 quarks.C:22
 quarks.C:23
 quarks.C:24
 quarks.C:25
 quarks.C:26
 quarks.C:27
 quarks.C:28
 quarks.C:29
 quarks.C:30
 quarks.C:31
 quarks.C:32
 quarks.C:33
 quarks.C:34
 quarks.C:35
 quarks.C:36
 quarks.C:37
 quarks.C:38
 quarks.C:39
 quarks.C:40
 quarks.C:41
 quarks.C:42
 quarks.C:43
 quarks.C:44
 quarks.C:45
 quarks.C:46
 quarks.C:47
 quarks.C:48
 quarks.C:49
 quarks.C:50
 quarks.C:51
 quarks.C:52
 quarks.C:53
 quarks.C:54
 quarks.C:55
 quarks.C:56
 quarks.C:57
 quarks.C:58
 quarks.C:59
 quarks.C:60
 quarks.C:61
 quarks.C:62
 quarks.C:63
 quarks.C:64
 quarks.C:65
 quarks.C:66
 quarks.C:67
 quarks.C:68
 quarks.C:69
 quarks.C:70
 quarks.C:71
 quarks.C:72
 quarks.C:73
 quarks.C:74
 quarks.C:75
 quarks.C:76
 quarks.C:77
 quarks.C:78
 quarks.C:79
 quarks.C:80
 quarks.C:81
 quarks.C:82
 quarks.C:83
 quarks.C:84
 quarks.C:85
 quarks.C:86
 quarks.C:87
 quarks.C:88
 quarks.C:89
 quarks.C:90
 quarks.C:91
 quarks.C:92
 quarks.C:93
 quarks.C:94
 quarks.C:95
 quarks.C:96
 quarks.C:97
 quarks.C:98
 quarks.C:99
 quarks.C:100
 quarks.C:101
 quarks.C:102
 quarks.C:103
 quarks.C:104
 quarks.C:105
 quarks.C:106
 quarks.C:107
 quarks.C:108
 quarks.C:109
 quarks.C:110
 quarks.C:111
 quarks.C:112
 quarks.C:113
 quarks.C:114