1,247 questions
0
votes
1
answer
70
views
Basemap plots in Matplotlib have cutoff map boundary lines
When trying to create a grid of maps in matplotlib using the Basemap toolkit, I noticed that the line that bounds the map projection is cut off on all four sides.
Look at the following minimal example ...
1
vote
1
answer
123
views
Python: Plotting a Basemap in the x-y-plane of a 3d plot
I am trying to get the code contained in
https://basemaptutorial.readthedocs.io/en/latest/basemap3d.html
to work. However, I get an error already in the first snippet:
import matplotlib.pyplot as plt
...
0
votes
1
answer
149
views
How to plot streamlines with netcdf data in python using cartopy or basemap?
I wanted to plot streamlines with NOAA from composite (2.5*2.5 lon/lat).
I tried to draw it with basemap (The codes are attached) but I face to this error: 'y' must be strictly increasing.
After that, ...
1
vote
1
answer
86
views
Python NetCDF Prime Meridian Line blank [duplicate]
I am trying to draw climatology map of GPCC precipitation.
But I found out there is a blank (data cut) in Prime Meridian Line.
How can I fix the problem? I can use CDO, NCO, Python.
I also share the ...
4
votes
1
answer
255
views
How to overlap a geopandas dataframe with basemap?
I have a shapefile that I read as a geopandas dataframe
import geopandas as gpd
gdf = gpd.read_file('myfile.shp')
gdf.plot()
where gdf.crs
<Projected CRS: ESRI:54009>
Name: World_Mollweide
Axis ...
1
vote
1
answer
52
views
Basemap with joint histograms plot
Here is the code returning the figure below:
import seaborn as sns
plt.figure(figsize=(8, 8))
gs = plt.GridSpec(3, 3)
ax_main = plt.subplot(gs[1:3, :2])
ax_lon = plt.subplot(gs[0, :2])
ax_lat = plt....
0
votes
1
answer
715
views
property of 'QuadContourSet' object has no setter error after update matplotlib in python
I wrote and ran a cod to plot a netcdf file. after upgrade pip and Libraries used , I got an error:property of 'QuadContourSet' object has no setter.
I would be grateful if someone could help me to ...
2
votes
1
answer
197
views
Python xarray, numpy, matplotlib netcdf masking ocean?
I am trying to draw linear regression map of NDVI.
But using countour map, it filled the ocean too.
I would like to remove the ocean without values.
using Nan or maskoceans
but maskoceans is not ...
0
votes
1
answer
2k
views
Add U.S. State Borders to plot
Can someone tell me how to modify the script below to add U.S. state borders using Geopandas? I have tried but can't seem to get it to work. Also, if there is a particular state border shapefile that ...
0
votes
1
answer
59
views
Why does the title show above the colorbar but below the map?
Please see the codes below:
plt.figure(figsize=(10,5))
m = Basemap(projection='cyl', resolution='c', llcrnrlat=0, urcrnrlat=90, llcrnrlon=0, urcrnrlon=360)
x, y = m(lon, lat)
scatter = m.scatter(x, y, ...
1
vote
0
answers
62
views
How to adjust colorbar height in Gridspec subplots
How can I produce 1x15 subplots where the first and second columns are filled contour and the third column will have two stacked horizontal line plots in each of the rows?
The code below is an example ...
0
votes
1
answer
116
views
Creating Animated SST Plot with Python
I would like to create a plot that showcases sea-surface temperature changing over the years, very similar to the SST maps that NOAA creates. The image I've inserted is essentially what the plot ...
0
votes
0
answers
139
views
Interpolating temperature data on geographical map using python, not giving good results on the edges
I am trying to plot some correlation data about temperature on a stereographic map of the north pole. the data is from different stations in this region.
I am using:
from scipy.interpolate : griddata ...
2
votes
1
answer
781
views
Plotting .netCDF data correctly, impossible in Python (Basemap, Cartopy)
I have been using .netCDF files (satellite data) for a few weeks now, and in general, I never had issues plotting them. I've been experimenting with sea ice concentration data but I can't get them ...
-1
votes
1
answer
355
views
Cartopy issue in polar stereographic projection
The issue only happens with contourf, not with pcolormesh.
How can I fix the discontinuity at longitude=0 (white stripe in the plot)?
1
vote
1
answer
170
views
Overlaying contour plot on basemap
Please can anyone look at this code it is not giving a desired result.
# use the Miller projection
m = Basemap( projection='mill', resolution='i', lon_0=0., lat_0=0.)
# draw coastline,...
0
votes
1
answer
142
views
Python Basemap pcolormesh valueError
I want to use Python basemap and map an aggregated value of income in various cities. I have created a dictionary of cities and their respective income. When plotting the code, I am getting an error ...
1
vote
0
answers
34
views
Can't remove package sucessfully with "conda remove"
I installed with a downloaded ".tar.bz2" file, but it couldn't work. So I used conda install basemap trying to cover the wrong one, this sentence carried out successfully, but the version of ...
1
vote
0
answers
119
views
Python basemap - struggling with putting a basemap on top of a satellite image
I have a satellite image taken from NWC-SAF of a certain region of the world, and 2 ndarrays that holds data about the latitudes and longitudes values of each pixel.
I try to use this information and ...
1
vote
1
answer
4k
views
Fix ValueError at matplotlib.pyplot.set_cmap() with custom LinearSegmentedColormap
I'm looking for a way to use custom color map with matplotlib.pyplot. I wrote this code:
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
import matplotlib as mpl
import ...
1
vote
0
answers
126
views
Why is my Networkx graph not plotting edges with Basemap?
I am trying to plot my Network Graph, produced with NetworkX over a Basemap - following the logic of this example. My netowkr will plot separately but when I run the code below I am just given the ...
0
votes
0
answers
481
views
Convert local coordinates to pixel values in python
I have a dataset that contains local coordinates of tracking cars, and I have an image related to my dataset, I would like to plot my track on the image, but the coordinate systems are not matched. I ...
0
votes
1
answer
72
views
convert a list to real number for scatter plot
I have two lists of latitude and longitude which latitude (xx) is like:
print(xx)
[['46.0'], ['-69.7'], ['-50.7'], ['-22.3'], ['-36.7'], ['65.1'], ['-26.3'], ['-47.5'], ['19.4'], ['-82.3'], ['50.8'], ...
0
votes
1
answer
2k
views
NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'
I was following this tutorial
I tried to run these codes:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.basemap import Basemap
map = Basemap()
fig = plt....
0
votes
0
answers
2k
views
Getting an error on pcolormesh (matplotlib) for masked array but my arrays aren't masked?
I'm trying to use matplotlib and basemap to plot temperature data from a netcdf file. My plotting code is:
fig = plt.figure(figsize=(10, 8))
m = Basemap(projection='lcc', resolution='c',
...