Reinstall the system, resulting in the need to reconfigure python. Python version 3.7.9 and cartopy version 0.19.0.post1 are used
Example code:
import numpy as np
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from cartopy.mpl.ticker import LongitudeFormatter,LatitudeFormatter
dlon,dlat=60,30
xticks=np.arange(0,360.1,dlon)
yticks=np.arange(-90,90.1,dlat)
fig=plt.figure(figsize=(6,5))
ax=fig.add_subplot(1,1,1,projection=ccrs.PlateCarree(central_longitude=120))
ax.coastlines()
gl=ax.gridlines(crs=ccrs.PlateCarree(),draw_labels=False,linewidth=1,linestyle=":",color="k",alpha=0.8)
gl.xlocator=mticker.FixedLocator(xticks)
gl.ylocator=mticker.FixedLocator(yticks)
ax.set_xticks(xticks,crs=ccrs.PlateCarree())
ax.set_yticks(yticks,crs=ccrs.PlateCarree())
ax.xaxis.set_major_formatter(LongitudeFormatter(zero_direction_label=True))
ax.yaxis.set_major_formatter(LatitudeFormatter())
plt.show()
The first time you use this command, you need to download the corresponding coalistline file, but there is a problem with the website in the program and you can’t download it. You need to download the file yourself on the earthnatural official website.
Place the file in C: \ users \ XXXX \. Local \ share \ cartopy \ shapefiles \ natural_ Under the earth \ physical path, if the program still reports an error when running, you need to delete the path (. Local \ share \ cartopy \ shapefiles \ natural_earth \ physical) and run it again. After generating the path of the same path, copy the downloaded physical into physical, run it again, and no error will be reported. Code reference Python meteorological drawing tutorial (VII) — cartopy
Read More:
- An error occurs when HBase uses the shell command: pleaseholdexception: Master is initializing solution
- When installing mysql, an error occurs when executing the installation command with the CMD window. Install / Remove of the Service denied
- Error occurs when configuring nginx installation information. / configure: error: the HTTP rewrite module requires the PCRE library. You can
- 1. Error running ‘application’ occurs when the command line is too long
- An error occurs when es logstash is installed and running
- An error occurs when pymysql uses% d to pass in parameters
- An error related to field none type occurs when allennlp executes the train
- To solve the problem that fastcgi process often fails recently, an unknown fastcgi error occurs
- Vue cli 4 CMD command creates an error: error command failed NPM install – loglevel error – solution
- Ant Design ‘cross env’ is not an internal or external command, nor is it an error reporting problem for a runnable program
- An error occurs when superstet connects to the Clickhouse database: error: could not load database driver: Clickhouse
- Python calls C to generate so library and reports an error: undefined symbol
- Configuring glfw library and glad Library in opengl-vs2015
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- OpenGL, such as glad library and glfw library, is incompatible
- Vs configuration of OpenGL development environment: configuration of glfw library and glad Library
- Net prompt is not an internal or external command
- The problem of failed to create process occurs in pyinstaller package program of Python
- Arduino reports an error when writing a custom library file to solve the problem of not name of type, not declared in this scope
- How to generate lib library with keil MDK and use lib Library