Ambient Lighting for 2D data in Paraview

Paraview is a powerful tool for the visualization of scientific data, especially for three-dimensional data. However, when I tried to visualize two-dimensional data, I realized that the colors in the colorbar differ from the colors that are rendered. This can be seen in the following picture, where the Mandelbrot set should be white instead of gray.

Default Paraview setting.

This is due to diffuse shading which is useful for rendering three-dimensional data to give an impression of depth. For two-dimensional data this is not needed. To change the lighting of the scene to pure ambient lighting we have to mark the data in the pipeline browser and enter the following lines1 into Tools -> Python Shell

render_view = GetRenderView()
render_view.LightSwitch = 0
render_view.UseLight = 0
dp = GetDisplayProperties()
dp.Ambient = 1.0
dp.Diffuse = 0.0

That way we obtain the correct colors:

Pure ambient lighting.