I noticed that when the plotting interval is very different from the interval where a TF1 is defined, undesired white gaps (or margins) appear around the plot. The more you zoom in, the larger the gaps are. Here is a very simple macro and the corresponding plot I obtain illustrating the problem.
Of course, a question is why there are margins at all, even when the plotting range is the same as the one used for function definition.

{
TCanvas *TestCanvas = new TCanvas("Test", "Test",600,600);
// We want to plot only on a range between 0 and 2.
TestCanvas->DrawFrame(0, 0, 2, 3);
// A TF1 defined with a range between 0 and 2.
// -> This one shows only small white spaces on the left and right of the curve.
auto fa2 = new TF1("fa2","1.05 + sin(x)/x",0,2);
fa2->SetLineColor(kGreen+3);
fa2->Draw("SAME");
// A TF1 defined with a range between 0 and 10.
// -> This one shows large white spaces on the left and right of the curve.
auto fa1 = new TF1("fa1","0.1 + sin(x)/x",0,10);
fa1->SetLineColor(kRed);
fa1->Draw("SAME");
}

{
TCanvas *TestCanvas = new TCanvas("Test", "Test",600,600);
// We want to plot only on a range between 0 and 2.
TestCanvas->DrawFrame(0, 0, 2, 3);
// A TF1 defined with a range between 0 and 2.
auto fa2 = new TF1("fa2","1.05 + sin(x)/x",0,2);
fa2->SetLineColor(kGreen+3);
fa2->SetNpx(500);
fa2->Draw("SAME");
// A TF1 defined with a range between 0 and 10.
auto fa1 = new TF1("fa1","0.1 + sin(x)/x",0,10);
fa1->SetLineColor(kRed);
fa1->SetNpx(500);
fa1->Draw("SAME");
}

Thanks for this answer!
Obviously, this solution (using SetNpx) cannot be used when the TCanvas is saved as a .C macro, since only the points are saved, and not the actual formula. That would mean functions should be created from the start with a number of points high enough. Correct?

Gaps appears because of the way how TF1 painting is implemented.
Actually not the function, but histogram is drawn.
By default histogram contains 100 points,
but you can change number by calling fa1->SetNpx(500);.
X position of each point defined by center of each histogram bin
which is created for the range you specified for TF1.

In your case you have range 0…2, 100 points. Making position of first point 0.01.
And last point is 1.99.

If you specifies range 0…10 with 100 points, first point coordinate will be 0.05.

You can try set TF1 range slightly more than visible range,
but ROOT painting probably will not extend your drawing to frame border.

You can try web painting running your macro with root --web macro.C to check if it will work better for you.

In a sense it is not really satisfying to have the curve of a function not plotted over the full range on which you want the function to be plotted. But I understand it would be a big paradigm shift not to use histograms to plot functions.