TCanvas frame showing

I’m creating some histograms and I want to minimise the margins so that they don’t have to be trimmed later. I have the following style function:

void PlotAesthetics::TH1Style(TH1* hHisto, TCanvas* canv, bool StatsBox)
{  
gStyle->SetMarkerColor(kBlue);
gStyle->SetMarkerStyle(8);
gStyle->SetMarkerSize(0.8);
  
gStyle->SetPadRightMargin(0.005);
gStyle->SetPadBottomMargin(0.11);
gStyle->SetPadTopMargin(0.01);

gStyle->SetTitleOffset(1.4, "Y");
gStyle->SetTitleOffset(1.2, "X");
  if(StatsBox==false)
    gStyle->SetOptStat(0);
  else
    {
      double yMax = hHisto->GetMaximum();
      yMax *= 1.1;
      hHisto->SetMaximum(yMax);

      TPaveStats* spStats = (TPaveStats*)hHisto->FindObject("stats");
      spStats->SetOptStat(1111111);
    }
  
  if(hHisto->GetMaximum()>=1&&hHisto->GetMaximum()<10)
    {
      gStyle->SetPadLeftMargin(0.08);
      gStyle->SetTitleOffset(1.1, "Y");
    }
  if(hHisto->GetMaximum()>=0.1&&hHisto->GetMaximum()<1)
    {
      //
    }
  if(hHisto->GetMaximum()>=0.01&&hHisto->GetMaximum()<0.1)
    {
      gStyle->SetPadLeftMargin(0.2);
      gStyle->SetTitleOffset(1.6, "Y");
    }
  canv->SetBorderMode(0);
  canv->SetBorderSize(0);

  canv->UseCurrentStyle();
}

But in the third if() case, the plot produced looks like this:


How do I get rid of the border on the left hand side?
Thanks in advance

@couet Can you help with this?