-
Notifications
You must be signed in to change notification settings - Fork 390
Open
Description
I have a script making thousands of plots in parallel. The main function prepares the matplotlib axis and a background (using mapbox tiles), then every worker adds data on the plot and saves the picture.
Here is a pseudo-code example
def main():
...
tile_source = cimgt.MapboxTiles(
access_token=os.environ["MAPBOX_KEY"], map_id="dark-v10", cache=True
)
fig, axis = plt.subplots(
1, 1, subplot_kw=dict(projection=tile_source.crs), figsize=(12, 12)
)
axis.add_image(tile_source, 6, interpolation="spline36")
...
# Spawns N concurrent processes with plotting function
def plotting_function():
...
axis.scatter()
...
plt.savefig()It seems that, even if I'm using caching, cartopy is trying to request the same tile multiple times, making a lot of requests to the server. I just realized this because of my mapbox account billing...
Why is this not working? what am I doing wrong? can't I just fetch the tile at the beginning when setting the axis and forget about it?
Metadata
Metadata
Assignees
Labels
No labels