Vertical labels

Hi Everybody!! :slight_smile:

I have plot a data from file in a TMultiGraph, then i would like rotate the x label from horizontal to vertical position. I know the LabelsOption work only with alphanumerics, infact the data from text file are only number, but the result it is :
Warning in TAxis::Sort: Cannot sort. No labels.

the code is similar this:

TGraph *gr = new TGraph (“data.txt”);
gr->Getxaxis()->LabelsOption(“v”);
gr->Draw();

where is the problem?

thank you to all
best reguards

Alphanumeric labels work on histograms only. Not on graphs

For Graph there isn’t a methods for do it?

No, alphanumeric label work on binned data only (for obvious reasons). TGraphs are not binned

It is not possible change the x labels to transform it in bin?

You should create an histogram with the alphanumeric bins you need then fill it as you wish using the Y vector of the graph.

HI
you may try the att macro
Otto
vertical_labels.C (488 Bytes)