# How to improve a DensityPlot? [duplicate]

Given that

x1 =
-((π^2 (x - x0) Cosh[π (x - x0)]) /
(2 (-Cos[π (y - y0)] + Cosh[π (x - x0)]))) + (π^2 (x - x0) Cosh[π (x - x0)]) /
( 2 (-Cos[π (-1 + y + y0)] + Cosh[π (x - x0)])) + (π^2 (x - x0) Sinh[π (x - x0)]^2) /
( 2 (-Cos[π (y - y0)] + Cosh[π (x - x0)])^2) - (π^2 (x - x0) Sinh[π (x - x0)]^2) /
( 2 (-Cos[π (-1 + y + y0)] + Cosh[π (x - x0)])^2)


I want to do a density plot by using:

DensityPlot[ x1 /. {x0 -> 0, y0 -> 0.2}, {x, -0.5, 0.5}, {y, -0.5, 0.5}]


But there are some white regions which are not plotted by density color. How to plot the density color also in the white regions?

## marked as duplicate by Michael E2, Jens, Yves Klett, Rahul, ciaoJul 5 '14 at 19:49

• Try PlotRange->All – Kuba Jul 5 '14 at 15:25
• Use PlotPoints -> 80 – molekyla777 Jul 5 '14 at 15:29

ContourPlot gives a clearer picture here:

ContourPlot[x1 /. {x0 -> 0, y0 -> 0.2}, {x, -0.5, 0.5}, {y, -0.5, 0.5},
PlotRange -> All,
PlotPoints -> 15,
ContourLines -> False,
ColorFunction -> "DarkRainbow"]


Compare:

DensityPlot[x1 /. {x0 -> 0, y0 -> 0.2}, {x, -0.5, 0.5}, {y, -0.5, 0.5},
PlotRange -> All,
PlotPoints -> 50,
ColorFunction -> "DarkRainbow"]


DensityPlot[x1 /. {x0 -> 0, y0 -> 0.2}, {x, -0.5, 0.5}, {y, -0.5, 0.5},