TGraph SetMarkerStyle(31)

Dear ROOTers,

I have come across a problem with TGraph for marker style 31. Drawing my simple graph with marker style 31 does not show the desired marker, only the default marker is plotted in version 5.26.00. Please compare

TGraph *gr = new TGraph()
gr->SetPoint(0,1,1)
gr->SetPoint(1,10,10)
gr->SetMarkerStyle(24)
gr->Draw(“AP”)

with

TGraph *gr = new TGraph()
gr->SetPoint(0,1,1)
gr->SetPoint(1,10,10)
gr->SetMarkerStyle(31)
gr->Draw(“AP”)

and

TGraph *gr = new TGraph()
gr->SetPoint(0,1,1)
gr->SetPoint(1,10,10)
gr->SetMarkerStyle(3)
gr->Draw(“AP”)

. Apparently marker style 3 shows, but style 31 would not. On the reference page
root.cern.ch/root/html528/TAttMarker.html
they seem to be quite similar anyway, I’ll just use 3 for my code.

thanks very much,
Martin

On ROOT 5.28/00b I get marker 31 the same as 3.
Try to execute on the ROOT prompt (copy&paste from here):
TCanvas *c = new TCanvas(“c”,“Marker types”,0,0,500,200);
TMarker marker;
marker.DisplayMarkerTypes();

Hi Pepe,

thanks for your quick reply. Yep, that sounds like a overdue update of my ROOT version- Apparently in 5.26 no marker styles above 30 are implemented. Sorry for not having checked with a newer version- the canvas I get when executing your commands is attached.

cheers,
Martin

I don’t know where these styles 31 … 34 come from.
The TAttMarker description (link given in your original post here) also explicitly lists “marker numbers” up to 30.
I have ROOT 5.28/00b here, I get a similar picture as in the TAttMarker description but the “$ROOTSYS/include/TAttMarker.h” here also defines them only up to 30 (see “enum EMarkerStyle”).
BTW. Note that I took the code from the TAttMarker description itself - each “Picture” has a “Source” button - just click it.

Have a look of the last marker list here:
https://root.cern.ch/doc/master/classTAttMarker.html#M2
The one you show is not up to date

Yes, it seems that the list of valid “marker numbers” is ROOT version specific (the original author uses 5.26, I 5.28).
A stupid question. Will these new “marker numbers” (31-34) get "marker names (i.e. “enum EMarkerStyle”)?

See root.cern.ch/root/v528/Version52 … tml#graf2d

Done