I want to draw weather map and it's my first time to draw by myself. I used below code and it works roughly but I want to make figure clearly.
import matplotlib.pyplot as plt
import numpy as np
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
from cartopy.mpl.ticker import LongitudeFormatter , LatitudeFormatter
import pandas as pd
file_path= 'D:/기상청ASOS/SH1.0925.high.csv'
df = pd.read_csv(file_path, encoding = 'euc-kr')
lon = df['lon']
lat = df['lat']
hgt = df['hgt']
ws = df['ws']
u = df['u']
v = df['v']
fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(1,1,1,projection=ccrs.PlateCarree())
ax.set_extent([125,131,33,38])
ax.coastlines('110m')
ax.stock_img()
ax.set_xticks(np.arange(105,146,5),crs=ccrs.PlateCarree())
ax.set_yticks(np.arange(20,56,5),crs=ccrs.PlateCarree())
ax.xaxis.set_major_formatter(LongitudeFormatter())
ax.yaxis.set_major_formatter(LatitudeFormatter())
cs = ax.tricontour(lon, lat, hgt , levels=30, colors = 'grey')
ax.quiver(lon,lat,u,v, scale = 300, color = 'black' , transform=ccrs.PlateCarree())
ax.clabel(cs, inline=True, fontsize=8)
ax.gridlines(crs =ccrs.PlateCarree(), draw_labels= True)
High = hgt > 850
Low = hgt < 710
lon_H, lat_H = lon[High], lat[High]
lon_L, lat_L = lon[Low], lat[Low]
lon_H_center, lat_H_center = lon_H.mean() ,lat_H.mean()
lon_L_center , lat_L_center = lon_L.mean(), lat_L.mean()
ax.text(lon_H_center , lat_H_center , 'High' , color='red', ha = 'center' , va='center', fontsize = 12,transform=ccrs.PlateCarree())
ax.text(lon_L_center, lat_L_center, 'Low', color='blue', fontsize= 12, ha='center',va='center', transform=ccrs.PlateCarree())
plt.show()
I used ChatGPT to reslove that problem. the answer is inserting 'x_inline=False,y_inline=False' in ax.gridlines(....) or revising to 'ax.set_xticks([])'. but it doesn't work like magnifying another part of map etc..
I just want to delete stack of x,y axis scale(25,30,35). How should I do?
and there is one more question.. I'd like to draw my weather map background like attached image.enter image description here What part to revise of my code?