Histogram fill transparency not working (EPEL7 package)

ROOT Version: 6.12.06
Platform: CentOS7
Compiler: precompiled EPEL7 binary

Maybe I’m stupid and, as usual, I’m missing something trivial but… The following macro does not produce any transparent fill color in my histogram:

    TH1D * h = new TH1D("h", "h", 10, 0, 1);
    h->FillRandom("gaus", 100);
    h->SetFillColorAlpha(kBlue, 0.5);

any clue? Missing compile time option?

PS: Also, in the GUI editor, the "opacity’ parameter is not available…

1 Like

It works for me. I get the attached picture.
Also notice the opacity slider in the GUI.

I tried with the ROOT version 6.12.05 and with the master version on mac.

I know, it works fine also on my mac, but here’s the output on Linux:

As you see the slider is unusable :confused:

PS: you didn’t select the histogram in the GUI editor

I tried ROOT 6.12/06 (binaries provided by the ROOT Team) on Ubuntu 14 (ran locally) and CentOS 7 (ran via “ssh -X -Y”) and I get it fine.

Yes and the blue is fully blue, not half tone blue as it should be.

It does not matter if it works for one objet it works for all. If I click on the histogram the slider is active also.

We just tried on a CENTOS 7 machine with ROOT 6.13 and it works fine.

I can reproduce the issue in the following Docker container:

FROM centos:7

USER root

RUN yum install -q -y epel-release && \
    yum install -q -y root

CMD /bin/bash

with the usual sudo docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix command. Could you check? (you’ll see OpenGL errors, I don’t have them on my pc…)

Interesting feature: if I save the canvas as PDF the transparency is drawn correctly

Ah ! that’s why it does not work. OpenGL is mandatory in that case.

Yes PDF output is an independent module I implemented in ROOT as the TPDF class. It is completely disconnected from the screen display. I implemented transparency in that class.

What “OpenGL errors” are you talikng about?
If you just get something like this, then it is still fine:

libGL error: failed to open drm device: Permission denied
libGL error: failed to load driver: r600

These are the errors you’ll get in the container when starting ROOT:

libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

And I’ve always had them within my CentOS containers, I remember struggling a lot in the past to get rid of them but never succeeded (all the OpenGL stuff is correctly installed as a dependency of the EPEL7 ROOT rpm)… Also, as I said, I don’t get any of those errors in my CentOS7 physical machine.

Moreover, despite of the errors, I’ve never encountered any kind of issue by running ROOT graphics from containers (maybe until now…?)

Maybe, instead of the “docker”, you could try the “Singularity” (which is claimed to work flawlessly with X11).

In any case, of course, your “X display server” needs to have OpenGL support built in (and the “container” with ROOT, too, of course).

Sure, I use Singularity too, but unfortunately the situation is the same, e.g. with the following recipe file:

Bootstrap: docker
From: centos:7

    yum -y -q install epel-release
    yum -y -q install root

I get the same errors. The fact that I don’t have them on my pc, where X11 and ROOT are installed in the same way, still puzzles me.

However, you could be right, maybe the Xorg distribution for CentOS7 does not have OpenGL support, I have to check…

On your “container”, before you start ROOT or another OpenGL (GLX) application (e.g. “glxinfo” and/or “glxgears”), try:
[bash]$ export LIBGL_ALWAYS_INDIRECT=1
[tcsh]$ setenv LIBGL_ALWAYS_INDIRECT 1

See also:
CMSPublic -> OpenGL and X11 problems

Oh, nice, no more libGL errors… Thanks!

However, as suspected, this has nothing to do with the transparency issue… have to check the OpenGL support thing

Maybe, instead of executing “yum -y -q install root”, you could try to download and unpack the ROOT 6.12/06 binary distribution provided by the ROOT Team.

BTW. Have you checked that you have the “root-graf3d-gl” package installed? Maybe it is an optional package which you need to manually add using yum.

I’ll try!

I didn’t have it, but after installing it the issue was still there…

Update: the problem remains also with the official binary distribution, so it shouldn’t be a ROOT issue

Try maybe:

I already tried to add e.g.

Section "ServerFlags"
    Option "AllowIndirectGLX" "on"
    Option "IndirectGLX" "on"

to /etc/X11/xorg.conf!

I think you need to “enable_iglx” on your mac (using the “magic” command shown in the link).

But I am working on a CentOS7 machine since the beginning…