Skip to content

Pylab contourf plot using Mollweide projection create artefacts #1910

Closed
@ghost

Description

matplotlib 1.1.1rc, python 2.7.3, Ubuntu 12.04 LTS

pylab.contourf create artefacts when used in a Mollweide projection.

Here is an example code:

import numpy as np
import pylab as plt

ra = np.linspace(-np.pi, np.pi, 40)
dec= np.linspace(-np.pi/2, np.pi/2, 20)
X,Y = np.meshgrid(ra,dec)
Z = np.sin(X) * np.cos(X) * np.sin(Y) * np.cos(Y)

plt.figure()
ax = plt.subplot(111, projection = 'mollweide')
ax.contourf(X,Y,Z,100)
ax.contour(X,Y,Z,10,colors='k')

plt.show()

Some of the points seem to be wrongly drawn (See Figure below).
mollweide
The same code used without projection outputs a perfectly normal map:
normal

You may have noticed that the contour lines work in both images. The artefacts seem to be always at the same place.

[Originally posted on Stackoverflow: http://stackoverflow.com/questions/16018243/pylab-contour-plot-using-mollweide-projection-create-artefacts ]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions