SetTickSize - how do I set option "S"

Dear Root-people,

I have been asked to remove the tick marks from the Y-axis of my spectra. I understand that to do I “must specify the option “S”.”

I have tried putting it in chopt

TGaxis *gaxis = new TGaxis(100,0,3000,0,50,1500,510,"S+"); gaxis->SetTickSize(0);

but this does not work.

My question is simple - Where and how must I specify the option “S”

Regards

Why are you using TGaxis ? … can you provide a small running example ?

Dear Couet,

Unfortunately I am currently in transit so I won’t have access to a system on which I can code an example until tomorrow evening. I will put a short working script up as soon as I can.

Regards

sure … no problem …

Dear Couet,

Here is a short running script that illustrates the problem - I would like to shorten or remove the tick marks on both the x-axis and the y-axis - but this is starting with the x-axis

void TickSizeIssue(){
	TCanvas *TC;
	TC = new TCanvas("Test", "Test",5,5,845,605);
	TF1 *f1 = new TF1("f1","TMath::Abs(sin(x)/x)",0,30);
	f1->Draw();
	TGaxis *gaxis = new TGaxis(0,0,15,0,15,15,510,"+S");
	gaxis->SetTickSize(0);
	gaxis->SetTitleColor(1);
	gaxis->SetTitleFont(22);
	gaxis->SetName("energy");
	gaxis->SetTitle("energy (keV)");
	gaxis->CenterTitle();
	gaxis->Draw(); 
}

Any pointers you can give would be appreciated.

Regards

{
   TCanvas *TC;
   TC = new TCanvas("Test", "Test",5,5,845,605);
   TF1 *f1 = new TF1("f1","TMath::Abs(sin(x)/x)",0,30);
   f1->Draw();
   f1->GetXaxis()->SetTickLength(0);
   f1->GetXaxis()->SetTitle("energy (keV)");
}

Thank you