This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Greetings! I unfortunately don't have much light to shed on these performance issues. You might want to try out this PR which tries to improve the situation: https://github.com/SciTools/cartopy/pull/1690 You could possibly try manually transforming your coordinates and re-use them across the different plots, but this issue implies that might not be the bottleneck: https://github.com/SciTools/cartopy/issues/1291 I'm also not sure if the latest CartoPy version (0.19) helps the situation at all. I know that's not much to go on--I haven't had many cycles myself to try to dig into the problem. On the imshow() front, if you're running into oddities, it might be helpful to post issues to CartoPy so that they might eventually get fixed. Cheers! Ryan > Hi all, > > I'm hoping you can provide some guidance-or an update-on any efforts to > improve the speed of using filled contour plotting with Cartopy. > > I'm currently working through (re)learning plotting procedures, migrating > over the matplotlib/basemap to matplotlib/cartopy/metpy. We work with mainly > grib and grib2 data, so I'm running into strange behavior via imshow at > times, and feel like I'm forced into contourf applications for color filled > graphics. > > This is fine-preferred really, given the level of control the > matplotlib/cartopy/contourf combination provides. However, I've noticed with > complex plotting (e.g. global data, hi-resolution data, multi-panel data), > the time contourf takes is prohibitively slow when employing cartopy. A > simply four panel plot for GFS variables at various heights, employing > contourf four times, can take several minutes. I'll need to generate > hundreds of images as new NWP data arrives-so this isn't a workable solution. > > I'm happy to provide some sample code if need be, to provide some background > on my current coding approach (it's very basic at this point, believe me) but > I thought I'd start by simply asking if there are some know community "hacks" > or fixes for this issue. I've spent some time reading various discussions on > Stack Overflow and github on the problem...but am having a hard finding if a > formal 'solution' has been reached. > > Any help would be appreciated! > > p.s. I current am running Cartopy 0.17. Ticket Details =================== Ticket ID: ACE-827366 Department: Support Python Priority: Low Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.