The definition of a polytrope is one for which the pressure and density are related by
$$ P = K \rho^{(n+1)/n}$$
The pressure is thus assumed to be independent of temperature and this simplifies the equations of stellar structure so that certain analytic solutions and approximations are possible.
It is however a big assumption and is generally only accurate for stars/planets supported by degeneracy pressure, where $1.5<n<3$ depending on whether the degeneracy is non-relativistic or relativistic. The other instance is where the energy transport is by adiabatic convection, which gives an independent relationship between $P$ and $T$ and means that for a completely ionized gas that $P \propto \rho^{5/3}$ and $n=1.5$.
A further polytropic approximation can also be made where the energy transport is predominantly radiative and where it is assumed that the radiation pressure is a fixed proportion of the total pressure. In these circumstances $P \propto \rho^{4/3}$ and $n \simeq 3$.
I found a bit of a primer here, but most stellar astrophysics textbooks will go through this.
The Eddington standard model assumes a radiative ($n=3$) polytrope. The vast majority of the Sun, by mass, is indeed radiative and the polytropic approximation works reasonably well. However the outer parts of the Sun (beyond about 70% of the radius) are convective and so a single polytropic model does not fare so well. So what you can do is have a "mixed polytropic model", where you divide the star up into polytropic shells with different polytropic indices, each forming the boundary conditions for the ones above and below.
A double polytropic model for the Sun, with two zones that have $n_1\simeq 3$ in the interior and $n_2\simeq 1.5$ in the outer convection zone should be much more accurate.
But modern astrophysical calculations do not rely on the analytic approximations of polytropes and the Lane Emden equation. They numerically solve the coupled differential equations of stellar structure, subject to the boundary conditions imposed by an atmosphere on the top of the star.
EDIT: Unashamedly tempted by the bounty, I did a little bit more research. I came across some sort of high-level set of lecture notes by
Robert French of Swinburne University. He discusses modelling the Sun with composite polytropes at some length. On p.8 he describes how the matching criteria at the boundaries between polytropic zones is actually quite tricky and you have to let the matching radius and central density float in order to get a smooth join.
The conclusion he arrives at is that a combination of a $n_1=3$ and $n_2=1.5$ actually appears to do a worse job of fitting the entire Sun than modelling with a single average polytrope (although with $n$ varied depending on which physical quantity you want on the y-axis - e.g. $\bar{n}=3.11$ for density vs radius). If on the other hand you allow the polytropic indices and the interface radius be free parameters in order to get a good match to the standard solar model, you can get a really good fit with $n_1=3.94$ in the radiative zone, $n_2=1.58$ in the convection zone and an interface at 68% of the solar radius. (Plot reproduced below - compare these with the plots in your question!).