Skip to content

Bug: distorted markers #2669

Description

@rcomer

Description

Markers can be distorted on Cartopy plots.

Code to reproduce

import cartopy.crs as ccrs
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(projection=ccrs.PlateCarree())

ax.scatter([-27, -20], [38, 65], marker='P', s=400)
ax.coastlines()
ax.set_extent([-100, 70, 0, 90])

In this example, the horizontal part of the marker is not a consistent width all the way across.

Image

The markers in the equivalent Matplotlib plot look cleaner

fig, ax = plt.subplots()

ax.scatter([-27, -20], [38, 65], marker='P', s=400)
ax.set(xlim=[-100, 70], ylim=[0, 90], aspect=1)
Image

The problem goes away if I set linewidth=0 or edgecolor='none', so it seems Cartopy is somehow distorting the edges. Since the data and axes are in the same projection, this does not appear to be a transform issue.

Full environment definition

Operating system

RHEL9

Cartopy version

0.25.0 and main

conda list

# Name                    Version                   Build  Channel
_openmp_mutex             4.5                      20_gnu    conda-forge
accessible-pygments       0.0.5              pyhd8ed1ab_1    conda-forge
alabaster                 1.0.0              pyhd8ed1ab_1    conda-forge
asttokens                 3.0.1              pyhd8ed1ab_0    conda-forge
attrs                     26.1.0             pyhcf101f3_0    conda-forge
babel                     2.18.0             pyhcf101f3_1    conda-forge
backports.zstd            1.3.0           py314h680f03e_0    conda-forge
beautifulsoup4            4.14.3             pyha770c72_0    conda-forge
blosc                     1.21.6               he440d0b_1    conda-forge
brotli                    1.2.0                hed03a55_1    conda-forge
brotli-bin                1.2.0                hb03c661_1    conda-forge
brotli-python             1.2.0           py314h3de4e8d_1    conda-forge
bzip2                     1.0.8                hda65f42_9    conda-forge
c-ares                    1.34.6               hb03c661_0    conda-forge
ca-certificates           2026.2.25            hbd8a1cb_0    conda-forge
cartopy                   0.25.2.dev108+g97cfce002          pypi_0    pypi
certifi                   2026.2.25          pyhd8ed1ab_0    conda-forge
cffi                      2.0.0           py314h4a8dc5f_1    conda-forge
cfgv                      3.5.0              pyhd8ed1ab_0    conda-forge
charset-normalizer        3.4.7              pyhd8ed1ab_0    conda-forge
click                     8.3.2              pyhc90fa1f_0    conda-forge
click-plugins             1.1.1.2            pyhd8ed1ab_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_2    conda-forge
colorama                  0.4.6              pyhd8ed1ab_1    conda-forge
contourpy                 1.3.3           py314h97ea11e_4    conda-forge
cycler                    0.12.1             pyhcf101f3_2    conda-forge
cython                    3.2.4           py314h1807b08_0    conda-forge
decorator                 5.2.1              pyhd8ed1ab_0    conda-forge
distlib                   0.4.0              pyhd8ed1ab_0    conda-forge
docutils                  0.22.4             pyhd8ed1ab_0    conda-forge
exceptiongroup            1.3.1              pyhd8ed1ab_0    conda-forge
execnet                   2.1.2              pyhd8ed1ab_0    conda-forge
executing                 2.2.1              pyhd8ed1ab_0    conda-forge
filelock                  3.28.0             pyhd8ed1ab_0    conda-forge
fiona                     1.10.1          py314hbcf5174_6    conda-forge
fonttools                 4.62.0             pyh7db6752_0    conda-forge
freexl                    2.0.0                h9dce30a_2    conda-forge
geos                      3.14.1               h480dda7_0    conda-forge
giflib                    5.2.2                hd590300_0    conda-forge
h2                        4.3.0              pyhcf101f3_0    conda-forge
hpack                     4.1.0              pyhd8ed1ab_0    conda-forge
hyperframe                6.1.0              pyhd8ed1ab_0    conda-forge
icu                       78.3                 h33c6efd_0    conda-forge
identify                  2.6.18             pyhd8ed1ab_0    conda-forge
idna                      3.11               pyhd8ed1ab_0    conda-forge
imagesize                 2.0.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        8.8.0              pyhcf101f3_0    conda-forge
iniconfig                 2.3.0              pyhd8ed1ab_0    conda-forge
ipython                   9.12.0             pyhecfbec7_0    conda-forge
ipython_pygments_lexers   1.1.1              pyhd8ed1ab_0    conda-forge
jedi                      0.19.2             pyhd8ed1ab_1    conda-forge
jinja2                    3.1.6              pyhcf101f3_1    conda-forge
json-c                    0.18                 h6688a6e_0    conda-forge
keyutils                  1.6.3                hb9d3cd8_0    conda-forge
kiwisolver                1.5.0           py314h97ea11e_0    conda-forge
krb5                      1.22.2               ha1258a1_0    conda-forge
lcms2                     2.18                 h0c24ade_0    conda-forge
ld_impl_linux-64          2.45.1          default_hbd61a6d_102    conda-forge
lerc                      4.1.0                hdb68285_0    conda-forge
libarchive                3.8.7           gpl_hc2c16d8_100    conda-forge
libblas                   3.11.0          6_h4a7cf45_openblas    conda-forge
libbrotlicommon           1.2.0                hb03c661_1    conda-forge
libbrotlidec              1.2.0                hb03c661_1    conda-forge
libbrotlienc              1.2.0                hb03c661_1    conda-forge
libcblas                  3.11.0          6_h0358290_openblas    conda-forge
libcurl                   8.19.0               hcf29cc6_0    conda-forge
libdeflate                1.25                 h17f619e_0    conda-forge
libedit                   3.1.20250104    pl5321h7949ede_0    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libexpat                  2.7.5                hecca717_0    conda-forge
libffi                    3.5.2                h3435931_0    conda-forge
libfreetype               2.14.3               ha770c72_0    conda-forge
libfreetype6              2.14.3               h73754d4_0    conda-forge
libgcc                    15.2.0              he0feb66_18    conda-forge
libgcc-ng                 15.2.0              h69a702a_18    conda-forge
libgdal-core              3.12.3               he63569f_3    conda-forge
libgfortran               15.2.0              h69a702a_18    conda-forge
libgfortran5              15.2.0              h68bc16d_18    conda-forge
libgomp                   15.2.0              he0feb66_18    conda-forge
libhwy                    1.3.0                h4c17acf_1    conda-forge
libiconv                  1.18                 h3b78370_2    conda-forge
libjpeg-turbo             3.1.4.1              hb03c661_0    conda-forge
libjxl                    0.11.2               ha09017c_0    conda-forge
libkml                    1.3.0             haa4a5bd_1022    conda-forge
liblapack                 3.11.0          6_h47877c9_openblas    conda-forge
liblzma                   5.8.3                hb03c661_0    conda-forge
libmpdec                  4.0.0                hb03c661_1    conda-forge
libnghttp2                1.68.1               h877daf1_0    conda-forge
libnsl                    2.0.1                hb9d3cd8_1    conda-forge
libopenblas               0.3.32          pthreads_h94d23a6_0    conda-forge
libpng                    1.6.57               h421ea60_0    conda-forge
librttopo                 1.1.0               h46dd2a8_20    conda-forge
libspatialite             5.1.0           gpl_h2abfd87_119    conda-forge
libsqlite                 3.53.0               hf4e2dac_0    conda-forge
libssh2                   1.11.1               hcf80075_0    conda-forge
libstdcxx                 15.2.0              h934c35e_18    conda-forge
libstdcxx-ng              15.2.0              hdf11a46_18    conda-forge
libtiff                   4.7.1                h9d88235_1    conda-forge
libuuid                   2.42                 h5347b49_0    conda-forge
libwebp-base              1.6.0                hd42ef1d_0    conda-forge
libxcb                    1.17.0               h8a09558_0    conda-forge
libxml2                   2.15.2               he237659_0    conda-forge
libxml2-16                2.15.2               hca6bf5a_0    conda-forge
libxml2-devel             2.15.2               he237659_0    conda-forge
libxslt                   1.1.43               h711ed8c_1    conda-forge
libzlib                   1.3.2                h25fd6f3_2    conda-forge
lxml                      6.0.4           py314hae3bed6_0    conda-forge
lz4-c                     1.10.0               h5888daf_1    conda-forge
lzo                       2.10              h280c20c_1002    conda-forge
markupsafe                3.0.3           py314h67df5f8_1    conda-forge
matplotlib-base           3.10.8          py314h53a7804_200    conda-forge/label/testing
matplotlib-inline         0.2.1              pyhd8ed1ab_0    conda-forge
minizip                   4.0.10               h05a5f5f_0    conda-forge
munkres                   1.1.4              pyhd8ed1ab_1    conda-forge
muparser                  2.3.5                h5888daf_0    conda-forge
ncurses                   6.5                  h2d0b736_3    conda-forge
nodeenv                   1.10.0             pyhd8ed1ab_0    conda-forge
numpy                     2.4.3           py314h2b28147_0    conda-forge
openjpeg                  2.5.4                h55fea9a_0    conda-forge
openssl                   3.6.2                h35e630c_0    conda-forge
owslib                    0.35.0             pyhd8ed1ab_0    conda-forge
packaging                 26.1               pyhc364b38_0    conda-forge
parso                     0.8.6              pyhcf101f3_0    conda-forge
pcre2                     10.47                haa7fec5_0    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_1    conda-forge
pillow                    12.2.0          py314h8ec4b1a_0    conda-forge
pip                       26.0.1             pyh145f28c_0    conda-forge
platformdirs              4.9.6              pyhcf101f3_0    conda-forge
pluggy                    1.6.0              pyhf9edf01_1    conda-forge
pre-commit                4.5.1              pyha770c72_0    conda-forge
proj                      9.7.1                he0df7b0_3    conda-forge
prompt-toolkit            3.0.52             pyha770c72_0    conda-forge
pthread-stubs             0.4               hb9d3cd8_1002    conda-forge
ptyprocess                0.7.0              pyhd8ed1ab_1    conda-forge
pure_eval                 0.2.3              pyhd8ed1ab_1    conda-forge
pycparser                 2.22               pyh29332c3_1    conda-forge
pydata-sphinx-theme       0.17.0             pyhcf101f3_0    conda-forge
pygments                  2.20.0             pyhd8ed1ab_0    conda-forge
pykdtree                  1.4.3           py314hc02f841_2    conda-forge
pyparsing                 3.3.2              pyhcf101f3_0    conda-forge
pyproj                    3.7.2           py314h68799e9_3    conda-forge
pyshp                     3.0.3              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha55dd90_7    conda-forge
pytest                    9.0.3              pyhc364b38_1    conda-forge
pytest-mpl                0.19.0             pyhd8ed1ab_0    conda-forge
pytest-xdist              3.8.0              pyhd8ed1ab_0    conda-forge
python                    3.14.4          habeac84_100_cp314    conda-forge
python-dateutil           2.9.0.post0        pyhe01879c_2    conda-forge
python-discovery          1.2.2              pyhcf101f3_0    conda-forge
python_abi                3.14                    8_cp314    conda-forge
pyyaml                    6.0.3           py314h67df5f8_1    conda-forge
qhull                     2020.2               h434a139_5    conda-forge
readline                  8.3                  h853b02a_0    conda-forge
requests                  2.33.1             pyhcf101f3_0    conda-forge
roman-numerals            4.1.0              pyhd8ed1ab_0    conda-forge
ruff                      0.15.10              h7805a7d_0    conda-forge
scipy                     1.17.1          py314hf07bd8e_0    conda-forge
setuptools                82.0.1             pyh332efcf_0    conda-forge
setuptools-scm            9.2.2              pyhd8ed1ab_0    conda-forge
setuptools_scm            9.2.2                hd8ed1ab_0    conda-forge
shapely                   2.1.2           py314hbe3edd8_2    conda-forge
six                       1.17.0             pyhe01879c_1    conda-forge
snappy                    1.2.2                h03e3b7b_1    conda-forge
snowballstemmer           3.0.1              pyhd8ed1ab_0    conda-forge
soupsieve                 2.8.3              pyhd8ed1ab_0    conda-forge
sphinx                    9.1.0              pyhd8ed1ab_0    conda-forge
sphinx-copybutton         0.5.2              pyhd8ed1ab_1    conda-forge
sphinx-gallery            0.20.0             pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   2.0.0              pyhd8ed1ab_1    conda-forge
sphinxcontrib-devhelp     2.0.0              pyhd8ed1ab_1    conda-forge
sphinxcontrib-htmlhelp    2.1.0              pyhd8ed1ab_1    conda-forge
sphinxcontrib-jsmath      1.0.1              pyhd8ed1ab_1    conda-forge
sphinxcontrib-qthelp      2.0.0              pyhd8ed1ab_1    conda-forge
sphinxcontrib-serializinghtml 1.1.10             pyhd8ed1ab_1    conda-forge
sqlite                    3.53.0               h04a0ce9_0    conda-forge
stack_data                0.6.3              pyhd8ed1ab_1    conda-forge
tk                        8.6.13          noxft_h366c992_103    conda-forge
tomli                     2.4.1              pyhcf101f3_0    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_1    conda-forge
typing-extensions         4.15.0               h396c80c_0    conda-forge
typing_extensions         4.15.0             pyhcf101f3_0    conda-forge
tzdata                    2025c                hc9c84f9_1    conda-forge
ukkonen                   1.1.0           py314h9891dd4_0    conda-forge
unicodedata2              17.0.1          py314h5bd0f2a_0    conda-forge
uriparser                 0.9.8                hac33072_0    conda-forge
urllib3                   2.6.3              pyhd8ed1ab_0    conda-forge
virtualenv                21.2.4             pyhcf101f3_0    conda-forge
wcwidth                   0.6.0              pyhd8ed1ab_0    conda-forge
xerces-c                  3.3.0                hd9031aa_1    conda-forge
xorg-libxau               1.0.12               hb03c661_1    conda-forge
xorg-libxdmcp             1.1.5                hb03c661_1    conda-forge
yaml                      0.2.5                h280c20c_3    conda-forge
zipp                      3.23.1             pyhcf101f3_0    conda-forge
zlib                      1.3.2                h25fd6f3_2    conda-forge
zlib-ng                   2.3.3                hceb46e0_1    conda-forge
zstd                      1.5.7                hb78ec9c_6    conda-forge

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions