I'm trying to plot a few curves that show some singularity close to the ends of the abscissas axis. This works fine with samples=500 but it takes quite some time to create the plot. Is there a way to have "biased sampling" (say, to have a higher sampling rate close to some point of interest)? This is the MWE, and the image of the plot.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{semilogyaxis}[
width=8cm,
legend style={font=\footnotesize, at={(0.98,0.98)}, anchor=north east, draw=none,
/tikz/every even column/.append style={column sep=0.2cm}},
legend columns=2,
every axis y label/.style={at={(current axis.north west)},xshift=-10pt,rotate=0},
every axis x label/.style={at={(current axis.south)},yshift=-10pt},
]
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {1/(2*x-2*x^2)};
% E2/E1 = 3
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {-((1 + 2*x*(4 + x*(-5 + 2*x)) + sqrt(1 + 4*x*(-2 + x*(17 + x*(-38 + x*(41 + 4*(-5 + x)*x))))))/(-1 - 2*x*(4 + x*(-5 + 2*x)) + sqrt(1 + 4*x*(-2 + x*(17 + x*(-38 + x*(41 + 4*(-5 + x)*x)))))))};
% E2/E1 = 9
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {-((1 + 26*x - 34*x^2 + 16*x^3 + sqrt(72*(-1 + x)*x + (1 + 2*x*(13 + x*(-17 + 8*x)))^2))/(9*x*(-3 - 2*(-2 + x)*x) + (-1 + x)*(1 + 2*x^2) + sqrt(72*(-1 + x)*x + (1 + 2*x*(13 + x*(-17 + 8*x)))^2)))};
% E2/E1 = 27
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {-((1 + 80*x - 106*x^2 + 52*x^3 + sqrt(216*(-1 + x)*x + (1 + 2*x*(40 + x*(-53 + 26*x)))^2))/(27*x*(-3 - 2*(-2 + x)*x) + (-1 + x)*(1 + 2*x^2) + sqrt(216*(-1 + x)*x + (1 + 2*x*(40 + x*(-53 + 26*x)))^2)))};
% E2/E1 = 81
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {-((1 + 242*x - 322*x^2 + 160*x^3 + sqrt(648*(-1 + x)*x + (1 + 2*x*(121 + x*(-161 + 80*x)))^2))/(81*x*(-3 - 2*(-2 + x)*x) + (-1 + x)*(1 + 2*x^2) + sqrt(648*(-1 + x)*x + (1 + 2*x*(121 + x*(-161 + 80*x)))^2)))};
% E2/E1 = 243
\addplot [mark=none, domain=0.00001:0.99999, samples=50] {-((1 + 728*x - 970*x^2 + 484*x^3 + sqrt(1944*(-1 + x)*x + (1 + 2*x*(364 + x*(-485 + 242*x)))^2))/(243*x*(-3 - 2*(-2 + x)*x) + (-1 + x)*(1 + 2*x^2) + sqrt(1944*(-1 + x)*x + (1 + 2*x*(364 + x*(-485 + 242*x)))^2)))};
\legend{ $1$ \\ $3$ \\ $9$ \\ $27$ \\ $81$ \\ $243$ \\ }
\end{semilogyaxis}
\end{tikzpicture}
\end{document}


samples at={0,0.002,...,0.05,0.0.06,...,0.95,0.952,...1}(not tested) first high rate, in the middle lower rate and at the end again higher. Please add a MWE http://tex.stackexchange.com/ – Bobyandbob Mar 29 '17 at 16:50samples atoption, and indeed it could help, but I thought there must be a simpler way to do it. – aaragon Mar 29 '17 at 17:12\addplot[green,thick, samples at={0.00001,0.0001,...,0.05,0.06,...,0.90}] {1/(2*x-2*x^2)}; \addplot[blue, samples at={0.90,0.90005,...,0.99999}] {1/(2*x-2*x^2)};works. But because of some reasonssamples at={0.00001,0.0001,...,0.05,0.06,...,0.90,0.90005,...,0.99999}doesn't. – Bobyandbob Mar 29 '17 at 17:18