faca87
July 2, 2020, 10:07am
1
Hello, I usally use, in my macro, this string
float fillcolor=0.35;
h->SetFillColorAlpha(kBlue, fillcolor);
to paint my histograms…but in this macro
simlemma.cpp (110.0 KB)
it doesn’t work (ie. I get white graphs) in no one of my graphs and I can’t understand the reason because of.
Does anyone understand the bug?
Here the Root File https://we.tl/t-NXIqIUMa0c
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.20/24
Platform: Windows10
Compiler: VS2019
couet
July 2, 2020, 12:26pm
3
here one can read:
The transparency is available on all platforms when the flag OpenGL.CanvasPreferGL
is set to 1
in $ROOTSYS/etc/system.rootrc
, or on Mac with the Cocoa backend. On the file output it is visible with PDF, PNG, Gif, JPEG, SVG, TeX… but not PostScript.
faca87
July 2, 2020, 12:29pm
4
Thank you [quote=“couet, post:3, topic:40197, full:true”]
here one can read:
the flag OpenGL.CanvasPreferGL
is set to 1
in $ROOTSYS/etc/system.rootrc
, or on Mac with the Cocoa backend.
[/quote]
In other macros, I get the transparency…so my ROOTSYS/etc/system.rootrc
it means that it is setted to 1
couet:
[here]
On the file output it is visible with PDF, PNG, Gif, JPEG, SVG, TeX… but not PostScript.*
My output is pdf
couet
July 2, 2020, 12:40pm
5
Can you try the macro transparency
from here and see if you get transparency in the pdf ?
I copied the macro
transparency.cpp (2.6 KB)
but I get this error
Anyway, for example, if I run this macro
calomini.cpp (4.7 KB)
I get the trasparency
Calo_EnDep[0]_LG0_HORSA.pdf (14.4 KB)
I don’t get the trasparency, just using the simlemma.cpp macro…so surely there is a but I can’t find it and unfortunately it is not reported by the compiler…
couet
July 2, 2020, 1:27pm
7
just do
root [0] .x transparency.cpp
couet
July 2, 2020, 1:36pm
8
So you surely made a mistake copying the code from calamin.cpp
… Try to reduce the macro to the minimum (that’s what I would do anyway) and the error will show.
@couet it worked and I got the trasparency transparency.pdf (14.2 KB)
ok I try to reduce the macro!
faca87
July 6, 2020, 10:47am
10
Hi @couet I reduced the macro
simlemmarid.cpp (4.0 KB)
but I still can’t understand the bug. Can you test the reduced one please?
Thank you
couet
July 6, 2020, 11:07am
11
htemppdgv1->SetFillStyle(1001);
htemppdgv1->SetFillColorAlpha(kBlue, fillcolor);
1 Like
faca87
July 6, 2020, 11:21am
12
Thank you @couet …it solved, but it’s strange…Even if I never used this code in old macro…I don’t understand the reason because of I need it in this one.
couet
July 6, 2020, 11:33am
13
Because you need to tell that the histogram is drawn with a filled polygon. Otherwise it it drawn with a line.
faca87
July 6, 2020, 12:33pm
14
Thank you @couet then…what did I do (for example in this macro calomini.cpp (4.7 KB) ) to tell that the histogram is drawn with a filled polygon ?
couet
July 6, 2020, 1:15pm
15
No sure why. is it really important ?
faca87
July 6, 2020, 1:26pm
16
Don’t worry @couet it isn’t important! It was just a curiosity!
system
Closed
July 20, 2020, 1:29pm
17
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.