Second Y Axis on TH2F

Hi rooters,
I am a beginner, I’m running v5.30 of windows7.
I have a problem with an histogram (TH2F).
I’m trying to put two graphs on the same plot, with a second Y axis (on the right side).
I am trying following the online tutorials but I can’t repeat it on my script.
can you help me?
You can find attached the script
thanks
Cris
PS: I.m Sorry :blush: , I’ve already posted my topic directly to roottalk@root.cern.ch,
now I’ve joined the forum and I’m posting it again …here, only too to be sure.
multyplot_00.c (8.47 KB)

See $ROOTSYS/tutorials/hist/twoscales.C
and option X+ and Y+ here : root.cern.ch/root/html/THistPainter.html

I am a beginner too. I tried to run your multyplot_00.c but I get segmentation faults:

root [0] 
Processing multyplot_00.C...

 *** Break *** segmentation violation
 Generating stack trace...
 0x00007f550f986514 in <unknown> from /snap/root-framework/926/usr/local/lib/libCore.so
 0x00007f550f083520 in <unknown> from /usr/lib/x86_64-linux-gnu/libc.so.6
 0x00007f550f0c8404 in _IO_feof + 0x4 from /usr/lib/x86_64-linux-gnu/libc.so.6
 0x00007f550f4be6db in <unknown function>
 0x00007f550f4beef4 in <unknown function>
 0x00007f550f4c38b0 in <unknown function>
 0x00007f550f4c3a81 in <unknown function>
 0x00007f550ad1d8b2 in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f5509849056 in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f55097cbf20 in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f55098598d6 in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f550985c88a in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f55097c998f in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f55097c9d38 in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f55098a8f4b in <unknown> from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f5509570aac in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0x89a from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f5509574762 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) + 0xa6 from /snap/root-framework/926/usr/local/lib/libCling.so
 0x00007f550f7e1fc9 in TApplication::ExecuteFile(char const*, int*, bool) at TApplication.cxx:? from /snap/root-framework/926/usr/local/lib/libCore.so
 0x00007f550f7e16e4 in TApplication::ProcessFile(char const*, int*, bool) + 0x34 from /snap/root-framework/926/usr/local/lib/libCore.so
 0x00007f550f7e14ca in TApplication::ProcessLine(char const*, bool, int*) + 0xd72 from /snap/root-framework/926/usr/local/lib/libCore.so
 0x00007f550fce74dd in TRint::ProcessLineNr(char const*, char const*, int*) + 0x33b from /snap/root-framework/926/usr/local/lib/libRint.so
 0x00007f550fce5b8f in TRint::Run(bool) + 0x6c9 from /snap/root-framework/926/usr/local/lib/libRint.so
 0x000055d54613b5e4 in main + 0x8a from /snap/root-framework/926/usr/local/bin/root.exe
 0x00007f550f06ad90 in <unknown> from /usr/lib/x86_64-linux-gnu/libc.so.6
 0x00007f550f06ae40 in __libc_start_main + 0x80 from /usr/lib/x86_64-linux-gnu/libc.so.6
 0x000055d54613b245 in _start + 0x25 from /snap/root-framework/926/usr/local/bin/root.exe
Root > 

What can I do?

Besides that, I would be able to add more that two axes to a series of traces in a single graph:
time VS many traces
This thing is possible with python + matplotlib
Is it possible with ROOT?

I used: ROOT ROOT 6.28/08

Thanks to all

I would be able to add more that two axes to a series of traces in a single graph:
time VS many traces that occupy the same frame each one with its proper scale
This thing is possible with python + matplotlib
Is it possible with ROOT?

Thanks to all

Welcome to the ROOT forum

See: ROOT: tutorials/hist/twoscales.C File Reference and the X+ and Y+ options here ROOT: THistPainter Class Reference

Side Note:

This thread is 12 years old. You better create a new one in order to ask something even if it was already asked in the past.