# Increase the resolution of a TH2D plot on a TCanvas

**URL:** <https://root-forum.cern.ch/t/increase-the-resolution-of-a-th2d-plot-on-a-tcanvas/55199>\
**Category:** Newbie\
**Tags:** graphics, hist, root\
**Created:** [June 6, 2023, 12:29pm UTC](https://root-forum.cern.ch/t/increase-the-resolution-of-a-th2d-plot-on-a-tcanvas/55199 "2023-06-06T12:29:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/77aa72/32.png) [@Cas](https://root-forum.cern.ch/u/Cas)\
**Post date:** [June 6, 2023, 12:29pm UTC](https://root-forum.cern.ch/t/increase-the-resolution-of-a-th2d-plot-on-a-tcanvas/55199/1 "2023-06-06T12:29:23Z")

</div>

Dear all,

I am trying to plot TH2D histograms of different sizes:  
100 x 100  
200 x 200  
500 x 500  
1000 x 1000  
2000 x 2000  
5000 x 5000

But when I plot them on a canvas, the resolution does not seem to increase past 500 x 500 or so. I don’t see more pixels on the screen than roughly 500 x 500.  
My computer screen does not have 5000 x 5000 resolution, but I would have expected it to make it so big that it can’t fit my screen and I have to scroll over it, which would be fine.  
I am saving the histograms to a .pdf file (perhaps the problem is there?)

My code is as follows:

```auto
TH2D** histList = new TH2D*[nHists];
for(int i = 0; i < nHists; i++){
  histList[i] = new TH2D(Form(hist_%d, i), sizeX, x1, x2, sizeY, y1, y2);
  // Load contents of TH2D via reading in a .txt file 
  // And set via ->SetBinContent(x, y, <binContent>);
  TCanvas* c1 = new TCanvas("c1", "");
  histList[i]->SetStats(0);
  histList[i]->GetXaxis()->SetTitle("x");
  histList[i]->GetYaxis()->SetTitle("y");
  histList[i]->GetZaxis()->SetTitle("z");
  histList[i]->Draw("colz");
  c1->SetLogz();
  c1->SetCanvasSize(6000, 6000);
  c1->SetWindowSize(5000, 5000);
  c1->Print(<outputLocation>);
  c1->Close();  
}

```

Does anyone have an idea what I might be doing wrong?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 6, 2023, 2:56pm UTC](https://root-forum.cern.ch/t/increase-the-resolution-of-a-th2d-plot-on-a-tcanvas/55199/2 "2023-06-06T14:56:40Z")

</div>

```auto
auto c = new TCanvas("c", "c",3000,2000)

```

should work.
