1,247 questions
2
votes
1
answer
4k
views
how to plot the track of cyclone with marker colors according to intensity
I am trying to plot a track of a cyclone over a base map. I am successful in plotting it with markers of the same color what I want is to plot the markers according to the intensity change. I will ...
0
votes
2
answers
9k
views
Python, ValueError: not enough values to unpack (expected 2, got 1)
Iam getting an value error(ValueError: not enough values to unpack (expected 2, got 1) at the line for pcolormesh, any idea how to handle this.
import numpy as np
import matplotlib.pyplot as plt
...
3
votes
1
answer
3k
views
Trying to plot DATA POINTS on BASEMAP (Python)
I have some meteorological data about some stations in Tenerife Island (this Dataframe has lat,lon and temperature in certain points of the island) (The source of the data is AEMET opendata, so they ...
0
votes
0
answers
292
views
How can i draw a geomagnetic equator in the basemap as shown in the mention diagram using python?
Code for Drawing Magnetic Equator in basemap
As I am a beginner, i was trying to add a magnetic equator in the basemap but i was unable to draw even after trying many times. I googled it but couldn't ...
0
votes
1
answer
901
views
Is there a function for plotting a heading (360) direction from a GPS point in matplotlib/basemap?
I have to create a plot of a vessel underwater in the ocean. I have GPS data and heading data. The data set is in a pandas data frame. I want to plot the heading of the vehicle as an arrow coming off ...
0
votes
1
answer
435
views
Gridding irregular scatter data on basemap, trying different resolutions
I am trying to regrid/interpolate within a grid of a certain size, my dataset of irregularly scattered location (lat lon) tied variable values. My data is available as a dataframe with columns marking ...
0
votes
1
answer
788
views
Make globe with matplotlib-basemap in python
i found here:
https://makersportal.com/blog/2018/8/16/rotating-globe-in-python-using-basemap-toolkit
some codes to make globes with basemap.
They seem really good to me (I'm a beginner with basemap) ...
1
vote
0
answers
293
views
How can we can give names to each states on the basemap?
Can any help me out how can we give names to each states in the map itself. I am able plot the data points but not able name the sates as i am using the shapefile. If would have been plotting totally ...
3
votes
1
answer
271
views
Using matplotlib for share-x plot
I am a beginner for matplotlab. The expected result for me are the following
two axes share x axis
The two y-axis are at both ends of axes,
when I change the figure size , x-axis and y-axis scaling 1:...
0
votes
0
answers
44
views
How do I install Basemap in python? [duplicate]
I am trying to import Basemap into a Jupyter notebook. I installed it using the anaconda CMD promt and it installed along with some other packages like py-lief-0.9.0, geos-3.6.2, jupyterlab-1.2.6, ...
0
votes
2
answers
197
views
Drawing 3 dimension using python matplotlib
I'm trying to draw the following chart using python.
Can you help me out?
thanks
0
votes
0
answers
293
views
How can I solve this problem with 'PROJ_LIB'?
I just wrote a python code on Spyder and Jupiter, I get the same problem in the console:
File "C:\Users\Ahmed\OneDrive\Bureau\Code3\A Japanese Journey.py", line 34, in <module>
from ...
0
votes
1
answer
210
views
Basemap m.scatter not allowing points to appear on map and retain fillcontinents color
I have this Python code:
m = Basemap(projection='tmerc',
llcrnrlon=-10.56,
llcrnrlat=51.39,
urcrnrlon=-5.34,
urcrnrlat=55.43,
resolution='h'...
0
votes
2
answers
635
views
Generating Multiple basemap plots from NetCDF using loop
I need to generate multiple plots of geopotential height anomalies (data taken from NCEP NCAR reanalysis), for which I use python netCDF4 and basemap package. The code I wrote generates single image, ...
0
votes
0
answers
225
views
ValueError: not enough values to unpack (expected 2, got 1), basemap plots
I try to plot three different variables lat,lon,dectime with dimensions (3245,450),(3245,450) and (3245,).
The error type i get is obviously asscociated with the dimension of the variable dectime. ...
0
votes
1
answer
3k
views
Python updated political map of India with state boundaries
Can anyone help me with plotting the most recent political map of India which also includes state boundaries?
The default maps in basemap or cartopy does not include the disputed areas and state ...
2
votes
1
answer
2k
views
Plotting latitude and longitude from csv file
Hello been trying to do this all day!
I have created a map with Basemap and I am trying to plot all the latitude and longitude locations from the CSV file. Any ideas or tips?
Here is an image of the ...
2
votes
1
answer
2k
views
plot gridded map with lat-lon and fill values in csv file in Python
1I have a .csv file contains a few columns: lon, lat, var1, var2 ...
df = pd.read_csv('D:/file.csv')
gdf = gpd.GeoDataFrame(df)
Lon = df['lon']
Lat = df['lat']
Slope = df['slope']
Edit: How can I ...
0
votes
2
answers
101
views
Matplotlib: How to plot graph with time(HH24:MI) as Y-axis
I am trying to plot a chart showing when job(s) finished each day for different business date.
My pandas dataframe looks like ...
business_dt job_finish_time job_name
0 19/03/2020 20/...
0
votes
1
answer
638
views
Python- Basemap error when installing data-hires
Hello I'm installing basemap at anaconda 3.
I had the problem with the "PROJ_LIB" path but I have already solved it.
The problem is when I try to install the data-hires with:
conda install basemap-...
3
votes
1
answer
2k
views
Avoid overlaping labels at matplotlib + geopandas
I´ve found many examples on how to avoid overlaping text on matplotlib but none that I could figure out how to apply to my case.
I have a dataframe (mapadf1) with some information about brazilian ...
0
votes
1
answer
849
views
python matplotlib basemap show polygons in a map
I am trying to render a polygon using python matplot Basemap lib.
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
def render_polygon(lat, long):
map = Basemap(llcrnrlon=-...
0
votes
2
answers
271
views
Problem when importing basemap: KeyError: 'PROJ_LIB'
When I install basemap I obtained an "already done" code:
Requirement already satisfied: basemap in c:\users\paisa\anaconda3\lib\site-packages (1.2.1)
Requirement already satisfied: pyproj>=1.9.3 ...
1
vote
0
answers
35
views
How do to visualize with Matplotlib's basemap
I have tried to visualize the global cases of corona on a map using folium.circle how do I implement the same with matplotlib's basemap module.
currently my code looks like this:
x = data[['...
0
votes
1
answer
135
views
Problems installing and importing basemap
I have a problem when I import basemap library.
I have installed previously these libraries using anaconda prompt:
- Shapely (which includes GEOS library)
- utm
- proj4
- basemap
When I import ...
3
votes
1
answer
675
views
Altair Map, Is it possible to add a basemap?
I am working on a very basic map using Altair, using vector data (point locations). General visualization capabilities are great, but I can not find out if it is possible to use a basemap with my map. ...
0
votes
1
answer
661
views
How to plot a circle with a varying radius in each quadrant?
I'd like to draw a shape similar to the following example (from the Naval Research Laboratory TC page). The shape is defined by 4 radii, one for each quadrant.
I have multiple track centers in ...
0
votes
1
answer
344
views
Contour/Scatter Plot - Interpolated data not covering entire scatter plot
I am trying to create a map showing an interpolated values over a scatter plot, here my code so far
# define map extent
lllon = dd
lllat = bb
urlon = cc
urlat = aa
# Set up Basemap instance
m = ...
1
vote
1
answer
2k
views
Plotting gridded data with cartopy using NorthPolarStereo
I'm moving from Basemap to Cartopy and want to plot data for the Arctic Ocean that covers the pole.
I've decided to use the NorthPolarStereo() projection and am happy to use either pcolormesh or ...
0
votes
1
answer
372
views
Heat map on Basemap\RuntimeError matplotlib-basemap
I made heat map on basemap like this and evrything work well, but i want to add else label with number of occurrences, and i get: RuntimeError: No mappable was found to use for colorbar creation. ...
1
vote
0
answers
315
views
Python -basemap: issue with longitude convention, how to plot tectonic boundaries through 180°
I am new at plotting maps with Python matplotlib-basemap (usually using GMT but need a way that can easily be used to plot maps for teaching).
I want to plot a map of Indonesia up to middle Pacific, ...
0
votes
0
answers
636
views
Interactive Display of reflectivity data for PPI in matplotlib
As a part of our project, we need to display radar reflectivity data in Plan Position Indicator(PPI) image along with latitude and longitude. I am using plot_ppi_map function to Plot a PPI volume ...
0
votes
0
answers
161
views
Map scatter as a subplot in pandas dataframe
I have a grouped dataframe which contains value, lat, lon and year variables. I want to plot values at different locations per year on a map.
This is how my dataframe looks:
from mpl_toolkits....
0
votes
0
answers
259
views
Using mercator projection: I want to color only lands/countries, and all land(except Antarctica) plus all ocean gets colored
This code is from Basemap docs pages, with some changing to focus on my issue at hand.
I want to color(in this case, magenta) all lands(Antarctica can be overlooked), and all ocean should be white ...
1
vote
1
answer
433
views
can't locate shapefile in basemap Python
I put a shapefile "china.shp" in my working directory, I tried many ways to set the path to file for basemap to read it, like
m3= Basemap(llcrnrlon=77, llcrnrlat=14, urcrnrlon=140, urcrnrlat=51, ...
1
vote
0
answers
131
views
How to point an arrow box based on geographical coordinates on Basemap?
I am trying to draw an arrow box to specific coordinates but it's not accurate. The head of the arrow should point to the point that is being made by scatter. how can I fix the problem?
Here is my ...
1
vote
1
answer
368
views
How do I equalize the length of matplotlib-basemap axis with another subplot axis?
Any help with the issue is appreciated. I am having a problem with subplots when using Basemap. Using gridspec, I have created a figure in matplotlib which contains three subplots. I’d like to draw ...
6
votes
1
answer
3k
views
Plot_confusioin_matrix plot is not showing integer value instead it is showing some exponential value
from sklearn.metrics import confusion_matrix
from sklearn.metrics import plot_confusion_matrix
print('*** Test Accuracy ***',forest.score(X_test,y_test))
disp = plot_confusion_matrix(forest, X_test, ...
0
votes
1
answer
358
views
Matplotlib Basemap: Map Coordinates
I am looking for easy way to determine the how to extract lon lat coordinates for 'lcc' projection. I am trying to isolate Arabian Sea as shown in the following code but somehow what i get is zoomed ...
0
votes
1
answer
88
views
Plotting graph of 3 parameters (PosX ,PosY) vs Time .It is a timeseries data
I am new to this module. I have time series data for movement of particle against time. The movement has its X and Y component against the the time T. I want to plot these 3 parameters in the graph. ...
0
votes
1
answer
671
views
Determining if a coastline is present when using Basemap
The following program works when I do not include "drawcoastlines". Most of the points that I am mapping are big enough to include a coastline but on one particular map, no coastline is present. When ...
1
vote
1
answer
1k
views
Matplotlib Basemap: Removing Ocean
I have an meshplot onto which I want to overlay continents in basemap. I am using this code:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
m = Basemap(...
0
votes
0
answers
125
views
How to plot the same x and y axis values as the ones of a given matplot plot?
I want to plot with the same x and y axis values (in a separate subplot) the errorbar that I display in the following way (the errorbar is correlated to the histogram drawn under):
import matplotlib....
2
votes
1
answer
8k
views
Moving from basemap to cartopy
I am trying to move from Basemap in python2 to cartopy in python3. However, I am finding it difficult to transform some Basemap code block to cartopy:
Basemap (python2.7)
from mpl_toolkits.basemap ...
-1
votes
1
answer
332
views
How to map 3D spherical point configuration (not the earth) onto 2D plane?
I have a 3d spherical point set of 10 points, (2 layers of pentagonal loudspeaker array) 2. I want to obtain 2D representation of this configuration. (Mollweide, Mercator, Cylindirical or ...
1
vote
0
answers
41
views
How to make legends using python loop for each line/curve when making multiline plot from a list of text files by loop?
My code for creating multiline plot from a list of file using python is below:
import numpy as np
import matplotlib.pyplot as plt
import os
import glob
path = '/Users/atikulfarazi/Data/HVSR-Obspy-...
1
vote
1
answer
657
views
Labelling multiple points from CSV in basemap
I'm having issues labeling all the points plotted with the code below,
each row in the CSV file is name, lat,lon.
Points are plotting just fine.
Everything I've tried to have names be plotted along x,...
1
vote
1
answer
555
views
Python's Basemap doesn't align with correct coordinates?
I have a .dat file containing a list of coordinates (~100k) and a temperature at each coordinate. It has a structure like this:
-59.083 -26.583 0.2
-58.417 -26.250 0.6
-58.412 -26.417 ...
8
votes
2
answers
18k
views
How to set 0 to white at an uneven colormap
I have an uneven colormap and I want the 0 to be white. All negative colors have to be bluish and all positive colors have to be reddish.
My current attempt displays the 0 bluish and the 0.7 white.
Is ...
0
votes
0
answers
502
views
Extracting latitude/longitude from NetCDFs that don't have latitude/longitude variables
I have a NetCDF file (ERO) that doesn't have latitude/longitude as explicit variables. When I call ERO.variables.keys(), it returns
odict_keys(['FCST_ERO_Surface_FULL', 'OBS_ALL_A365324_FULL_MAX_49']...