Alphanumerical bin labels won't transfer with TSocket::Send


I use TH1::SetBinLabel to create alphanumeric labels for a histogram. While this works within that program, when I try to send it to another client with TSocket::Send, I lose the labels. Is there a workaround for this?

I am attaching the macros that reproduce the problem.



PS which root
hserv2_mod.C (2.06 KB)
hclient_mod.C (1.64 KB)

Hi Christos,

You are not drawing the histogram transfered via the socket but another one.
Simply replace (in hserv2_mod.C) the line

my_h->Draw(); by



Ah, yes, good point.

(The reason I do this at the receiving end is that I want to add the histogram that was just received to another one. But I still want to keep the original labels.)

Is there any flag I can check to see if the received histogram is using alphanumeric labels?


I think I found the answer. I want to be checking TAxis::GetLabels();

The following piece of code when I create a new histogram at the receiving end seems to do the trick

	       for(int i = 1; i != h->GetNbinsX()+1; ++i)
		       my_h->GetXaxis()->SetBinLabel( i, h->GetXaxis()->GetBinLabel(i));