Resolution problem with contours in TH2D

Dear experts,

sorry if this was already reported but I couldn’t find it in this forum.

What should I do to see in a viewer or in a printout what I see in a root
canvas? The problem in my case occurs when plotting TH2D with dashed
or dotted contours in a small canvas. The dashed contours are somehow seen in root but in the printout, they become just full lines. I use root 4.04/02 run on linux. I also played with SetLineStyleString but it didn’t help.
Would anybody know how to solve this?

Thank you, the code with an input file is enclosed.

h0bin2-sa-msusy1000-full.txt (363 KB)
marek.C (1.63 KB)

I do not see any dotted contours on your plot. Both screen and PS outputs look the same.

OK, after a short email exchange, let me share with the working solution Olivier Couet proposed.

The code I enclosed tries to plot a small canvas with TGraph2D with contours:

 TCanvas *c = new TCanvas("c","resol",0,0,500,300);
 TGraph2D *w7 = new TGraph2D(1700,a,b,c);
  TH2D* h7 = w7->GetHistogram("h7");
  double contours[4]={100,120,122,122.8};

The point is that the dashed contours are not seen in the output. The reason is that for such a small canvas and such a fine binning, there are
just a few pixels per bin so the line segments are very short and hence
there is not enough pixels to even draw one set of dashes.

If one doesn’t insist on the fine binning and can make it coarser, the problem may be solved by putting e.g.


Attention, if the data plotted by TGraph2D tend to be flat, one may see
unwanted peaks. They disappear by putting e.g.