Firstly, as R2 is a scalar, it cannot be plotted.
To plot the regression line, follow the example shown in the link below:
However, to get a similar output as shown in the above graph, you will have to make changes in the example. Refer to the sample code given below which is an extension of the example given in the link.
[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net = train(net,x,t);
y = net(x);
title(a,'Test Data, R^2=0.9893')
For calculating the value of R-squared(R2), which is given as the title of the graph, have a look at the following links:
Hope this helps!