matplotlib-basemap

subplots onto a basemap

Deadly 提交于 2021-02-11 14:34:54
问题 I have a map of the UK and 121 locations, each with 3 values. I would like to plot a little bar graph of the three values at each of the 121 locations. Currently, the values are plotted as the markersize attribute, which looks like this: Trypophobic_Plot made with the following code: (simplified massively) fig, ax = plt.subplots() ax = Basemap(llcrnrlat= 46.351611, llcrnrlon= -11.543011, urcrnrlat= 60.417133, urcrnrlon= 6.2743413, resolution='i', projection='tmerc', lon_0=-2, lat_0=49) #Draw

Matplotlib image getting stretched after using “Zoom to rectangle”

坚强是说给别人听的谎言 提交于 2021-02-11 13:37:07
问题 I am using the following code to plot the Matplotlib Basemap on tkinter canvas: from tkinter import * from tkinter.ttk import * import numpy as np from matplotlib.figure import Figure import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import (NavigationToolbar2Tk) from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg as FigureCanvas import os os.environ['PROJ_LIB'] = r'C:\Users\AppData\Local\Continuum\anaconda3\pkgs\proj4-4.9.3-vc14_5\Library\share' from mpl

makegrid equivalent in cartopy, moving from basemap to cartopy

老子叫甜甜 提交于 2021-02-11 05:33:36
问题 So, I have been using Basemap for years in Python 2.7, I am moving to Python3.7 and would like to move to cartopy. I work with a lot of data where I have the projection info but I don't have lat and lon grids of the data. This is how I would handle things in Basemap. m=Basemap( llcrnrlon=-118.300, llcrnrlat=20.600, urcrnrlon=-58.958, urcrnrlat=51.02, projection='lcc', lat_1=38., lat_2=38., lon_0=-95., resolution ='l', area_thresh=1000. ) mwidth = 1008 #for 163 5km AWIPS2 grid mheight = 722

How can emulate transform_vector of basemap in cartopy

大憨熊 提交于 2021-02-10 17:34:25
问题 I want to utilize basemap's transform_vector function and its ability to return x and y, in cartopy to plot barbs This is the code in basemap u1, v1, x1, y1 = bm.transform_vector(u, v, self.lons, self.lats, 16, 16, returnxy=True) bm.barbs(x1, y1, u1, v1, barbcolor='firebrick', flagcolor='firebrick', pivot='middle', linewidths=1) I want to achieve this in cartopy but transform_vectors in cartopy does not have option to returnxy, so how can I do this? Assume we already have u, v, self.lons and

Basemap error: module object is not callable

痞子三分冷 提交于 2021-01-28 08:00:32
问题 I am trying to learn how to use basemap in python. I used the following site for learning http://www.datadependence.com/2016/06/creating-map-visualisations-in-python/. but when I typed the following import matplotlib.pyplot as plt import matplotlib.cm import basemap fig,ax=plt.subplots(figsize=(10,20)) m=basemap(resolution='c',projection='merc',lat_0=54.5,lon_0=-4.36,llcrnrlon=-6.,llcrnrlat=49.5,urcrnrlon=2.,urcrnrlat=55.2) m.drawmapboundary(fill_color='#46bcec') m.fillcontinents(color='

annotate text to axes and align as a circle

半腔热情 提交于 2021-01-28 07:58:42
问题 I am trying to plot text on axes and align this text to a circle. More precisely there are points with different coordiantes (x,y) which are located inside this circle and created with: ax.scatter(x,y,s=100) I want to connect and label each point (Cnameb) with the circle. The coordinates of the text are defined with (xp,yp). Thus the arrows between the points and the circle are different in length but the overall distance between the center and the circle is the same as the following figure

How can I get my contour plot superimposed on a basemap

别说谁变了你拦得住时间么 提交于 2021-01-21 04:13:10
问题 This is a question I asked several months ago and am still struggling to come to a solution. My code gives me a basemap and a contour plot side by side (but printing to file only gives the contour plot), but I want them superimposed. The best solution would the one here https://gist.github.com/oblakeobjet/7546272 but this does not show how to introduce the data, and it is difficult when you are learning from scratch online. Without tiring very kind people, I hope the solution is easy as

How can I get my contour plot superimposed on a basemap

耗尽温柔 提交于 2021-01-21 04:12:32
问题 This is a question I asked several months ago and am still struggling to come to a solution. My code gives me a basemap and a contour plot side by side (but printing to file only gives the contour plot), but I want them superimposed. The best solution would the one here https://gist.github.com/oblakeobjet/7546272 but this does not show how to introduce the data, and it is difficult when you are learning from scratch online. Without tiring very kind people, I hope the solution is easy as

How can I get my contour plot superimposed on a basemap

自闭症网瘾萝莉.ら 提交于 2021-01-21 04:10:26
问题 This is a question I asked several months ago and am still struggling to come to a solution. My code gives me a basemap and a contour plot side by side (but printing to file only gives the contour plot), but I want them superimposed. The best solution would the one here https://gist.github.com/oblakeobjet/7546272 but this does not show how to introduce the data, and it is difficult when you are learning from scratch online. Without tiring very kind people, I hope the solution is easy as

Input Format to pcolormesh

一曲冷凌霜 提交于 2021-01-01 06:28:11
问题 I'm attempting to make heat/intensity map using Basemap. My inputs are a set of lats, lons, and intensity at that point. The dataset looks like this: lat[0], lon[0] = intensity[0] lat[1], lon[1] = intensity[1] ... lat[n], lon[n] = intensity[n] At each index the lat and lon correspond to the correct sensor reading. My code looks something like this: fig = plt.figure(figsize=(10, 8)) # Set title fig.suptitle("Intensities {} {}".format(start_time, stop_time)) # US Centered Map map_axis = fig.add