Question: # Create a figure and axis with PlateCarree projection fig, ax = plt . subplots ( figsize = ( 1 5 , 1 0 )

# Create a figure and axis with PlateCarree projection
fig, ax = plt.subplots(figsize=(15,10), subplot_kw={'projection': ccrs.PlateCarree()})
# Add features to the map
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.BORDERS)
ax.add_feature(cfeature.STATES, linestyle=':')
# Define a color map
unique_years = dixi['yr'].unique()
colormap = plt.cm.get_cmap('tab20', len(unique_years))
# Plot each tornado path with a different color based on the year
for year, color in zip(unique_years, colormap.colors):
year_data = dixi[dixi['year']== year]
ax.plot(year_data, transform=ccrs.PlateCarree())
# Add a legend
plt.legend(title='Year', loc='upper right')
# Set titles and labels
plt.title('Tornado Paths')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
# Show the plot
plt.show()
I am attempting to create a map with tornado paths colored by year, on a map of dixie alley, but I keep running into an error of AttributeError: 'GeoAxes' object has no attribute '_autoscaleXon'. Any assistance is appreciated.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!