Greetings!
I’m Zeeshan, theoretical particle physics research student.
We are working on histograms like draw some plots, but there are some issues regarding smoothness and position of legends in Canva. So please guide us if someone has knowledge/experience regarding that.
Our target is to draw smooth three plots but one of them is almost done but remaining two still unsolved so kindly let us fix it?
Here are commands to run it in root.
Open root as following…!
zeeshan@zeeshan:~/root$ root -l
root [0] .L normal_spectr02.cpp
root [1] main() normal_spectr02.cpp (44.7 KB)
I have attached file and reference with which, we have to match our results
I’d say you have to be much clearer in describing your issue, what you expect and what is “wrong” with what you are getting (or whether you are not getting anything, but in this case it seems your code runs well but the problem is only the aesthetics?). So please describe what you get and what exactly you want to change. In all cases, showing a 1200+ lines macro is far from ideal too, hardly anyone will go through that, especially when what you want is not clear. Try first to (greatly) reduce the code to a minimum that (ideally) we can also run to reproduce your problem.
The above being said, by looking at the very last lines in your macro it seems that your graph is the one at the bottom of your post (and you want it to look similar to the 3 that are together above?). For the y-axis title, for instance, if you don’t want it in 2 lines, don’t use #frac, just type the formula as you would in a line of text (e.g. 1/(2#pi) etc.). For the TLegend position you’ll have to play around until you find a position you like --if you run the macro in interactive move, as you are doing, you can move the TLegend with the mouse to a position and size you like, then save the canvas as a .C file (menu File → Save As… and give it some name.C) and then open that .C file and see the coordinates of the TLegend, to use those in your code.
Dear @Muhammad_Zeeshan,
I am not saying I am stuck. I just say that your macro gives the previously attached plot and I would like to know what do you think is wrong in that plot. Can you explain it so we can help you to fix your problem ? I simply ran your macro without any modification except the first line which I changed to void AllPlus_Cen0(): AllPlus_Cen0.C (53.8 KB)
Actually Sir, with due respect, I meant me and my research fellow, we both are stuck in this problem. So let me correct my previous words that we are hanged. Our task is to make smooth plots as given sample.
I am afraid we cannot help you a lot with the macro you sent. This macro was produce with SaveAs(...). The plot produced is reflecting the static data setting in this macro. Your question looks more general and we cannot help you with the macro. You sent. To summarize it the code in your macro produces something correct.
Greetings. Let me guide to run this code in root via Ubuntu terminal normal_spectr02.cpp (45.0 KB)
root -l normal_spectr02.cpp
main()
Then an error is showing… Like
Respected @couet. Greetings.
I am stuck in to fix the following error when running a code via root.
So, please need your guidance. normal_spectr02.cpp (43.6 KB)
Commands are:
root-l normal_spectr02.cpp
main()