Skip to content

Distorted iplt.points with circular coordinate #466

@isedwards

Description

@isedwards

iplt.points() distorts the output when longitude coordinate is circular. The second plot below shows the correct behaviour by setting circular to false: cube.coord('longitude').circular = False

Also, the current API documentation suggests that points() requires a list of coords as arguments, but the current implementation expects a cube.

figure_1

import iris.tests as tests
import iris
import iris.plot as iplt
import matplotlib.pyplot as plt

plt.switch_backend('tkagg')
pp_file = tests.get_data_path(('PP', 'globClim1', 'u_wind.pp'))
cube = iris.load(pp_file)[0][0]

plt.subplot(211)    
iplt.pcolormesh(cube, vmax=50)
iplt.points(cube, s=cube.data)
plt.gca().coastlines()
ax1 = plt.gca()

plt.subplot(212)
cube.coord('longitude').circular = False
iplt.pcolormesh(cube, vmax=50)
iplt.points(cube, s=cube.data)
plt.gca().coastlines()
ax2 = plt.gca()

plt.show()

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions