A bit tricky, but here it is:
void hlabels4()
{
TCanvas *c1 = new TCanvas("c1","transparent pad",200,10,700,500);
TPad *pad1 = new TPad("pad1","",0,0,1,1);
TPad *pad2 = new TPad("pad2","",0,0,1,1);
pad2->SetFillStyle(0);
Int_t i;
const Int_t nx = 10;
char *people1[nx] = {"Jean","Pierre","Marie","Odile","Sebastien", "Fons","Rene","Nicolas","Xavier","Greg"};
char *people2[nx] = {"Bjarne","Anton","Otto","Eddy","Peter","Pasha","Philippe","Suzanne","Jeff","Valery"};
TH1F *h1 = new TH1F("h1"," ",3,0,3);
TH1F *h2 = new TH1F("h2","h2",nx,0,3);
TAxis *ax = h2->GetXaxis();
TAxis *ay = h2->GetYaxis();
for (i=0;i<10;i++) ax->SetBinLabel(i+1,people2[i]);
ay->SetLabelSize(0.);
for (i=0;i<5000;i++) {
Int_t r = gRandom->Rndm()*10;
h1->Fill(people1[r],1);
}
h1->LabelsDeflate();
pad1->Draw();
pad1->cd();
h2->Draw("X+");
pad2->Draw();
pad2->cd();
h1->Draw();
}