Hi,
At the beginning of the program, I have defined some style.
TStyle *style1 = new TStyle("Plain", "style1");
style1->SetPalette(1);
style1->SetOptStat(0);
style1->cd();
In the middle, the program defines some TF1 objects.
TF1 *f_Log1 = new TF1("f_Log1", Log1, 0, 5, 4);
TF1 *f_Log2 = new TF1("f_Log2", Log1, 0, 5, 4);
f_Log1->SetParameters(43, 5, 1, 0.59);
f_Log1->SetLineWidth(2);
f_Log2->SetParameters(40, 5, 1, 0.65);
f_Log2->SetLineWidth(2);
At the end when I draw a TH2D histogram with the functions,
looks everything fine.
h_Th_P_pos[2]->Draw("col");
f_Log1->Draw("Same");
f_Log2->Draw("Same");
I saved this canvas by two ways
c2->Print("e1-6_Th_Pprot.eps");
c2->Print("e1-6_Th_Pprot.C");
When I open eps file the image is fine,
but when I run the .C file, I see that the color palette
has been changed, and each time I manually add line
gStyle->SetPalette(1);
in a .C macro. It also gives the following errors
In the .C file it defines TF1 without any function or formula,
TF1 *f_Log1 = new TF1("f_Log1","",0,5);
f_Log1->SetFillColor(19);
f_Log1->SetFillStyle(0);
f_Log1->SetLineWidth(2);
f_Log1->SetParameter(0,43);
f_Log1->SetParError(0,0);
f_Log1->SetParLimits(0,0,0);
f_Log1->SetParameter(1,5);
f_Log1->SetParError(1,0);
f_Log1->SetParLimits(1,0,0);
f_Log1->SetParameter(2,1);
f_Log1->SetParError(2,0);
f_Log1->SetParLimits(2,0,0);
f_Log1->SetParameter(3,0.59);
f_Log1->SetParError(3,0);
f_Log1->SetParLimits(3,0,0);
f_Log1->Draw("Same");
I guess therefore function can’t be drawn.
Is there any option which will keep
colour palette and TF1 objects unchanged.