matplotlib-basemap

How to use matplotlib blitting to add matplot.patches to an matplotlib plot in wxPython?

浪子不回头ぞ 提交于 2019-12-11 10:02:46
问题 I am making a plot using the matplotlib library and showing it in my wxPython GUI. I am plotting a massive amount of data points from a LIDAR instrument. The thing is, I would like to draw rectangles in this plot to indicate interesting areas. But when I draw a rectangle on the same axes as the plot, the whole plot gets replotted which takes lots of time. This is because of the self.canvas.draw(), a function which replots everything. The code gets displayed as follows in the GUI: Printscreen

Select starting color in matplotlib colormap

老子叫甜甜 提交于 2019-12-11 09:19:47
问题 I have the figure shown below. Presently the figure's colorscheme uses the entire range of the colormap (mpl.cm.Paired). What I want to do, and have been unable to figure out, is how to limit matplotlib to use only a subset of the colormap. In this case I am trying to get the starting color to be a darker shade of blue. Here's the plotting section of my code: Figure = plt.figure(figsize=(22,10)) Map = Basemap(projection='robin', lon_0=0, resolution='l') x, y = Map(LONS, LATS) levels = np

Installing matplotlib vn 1.2 and Basemap on Ubuntu

China☆狼群 提交于 2019-12-11 07:52:29
问题 I'm trying to install vn 1.2 of Matplotlib on my Ubuntu computer so that I can use some of the animation features. Crucially I also need Basemap. The only way I've found of importing Basemap is through apt-get. I can install matplotlib 1.2 loads of different ways - using pip, apt-get and from source, but no matter what I do, when it comes to typing in sudo apt-get install python-mpltoolkits.basemap I'm always told that matplotlib will be installed because apt-get can't see the version 1.2

How to remove contour/ path inside ploygon on basemap using matplotlib?

会有一股神秘感。 提交于 2019-12-11 07:31:16
问题 I am working with some weather data to plot contour lines on basemap using matplotlib. The data I have used (x, y and data) is uploaded here http://www.mediafire.com/download/0epjjdm8auit611/mslp.txt here http://www.mediafire.com/download/1dn6p8nw96h2mmd/xlong.txt and here http://www.mediafire.com/download/31suzsz6j7u2bgz/xlat.txt. The working example code is below:- from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import

installing Basemap module - Command ''python setup.py egg_info'' failed with error code 1

南笙酒味 提交于 2019-12-11 05:26:43
问题 I have run into a problem that has been bothering me for hours. I found multiple occurrences of this problem (some are kinda old) in this site and others but no solution worked for me so I decided to try and ask for help on my individual problem.. I'm using Windows 10 and Python 35-32, 32 bit. I have downloaded basemap-1.1.0-cp35-cp35m-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and tried to install it with pip install [FULL PATH] in Administrator Command Prompt. I have

Can´t freeze a script with matplotlib basemap and cx_freeze

可紊 提交于 2019-12-11 04:00:30
问题 back again. I am still working on it but I can not fix it The script is running fine but when I freeze it using cx_freeze a cx_freeze error appears. at the end of the message says OSError:proj data directory not found. Expecting it at: C:\python34........mpl_toolkits\basemap\data Is the data not included in the build directory created by cx_freeze ? I am using the following script for freezing base = None def find_data_file(pyproj): if getattr(sys,'XXXXs.exe',False): datadir = os.path.dirname

mlab.griddata bug?

眉间皱痕 提交于 2019-12-11 02:20:06
问题 I'm using mlab.griddata to interpolate some data when I encountered a strange and what looks like floating point precision bug. This is calling sequence: nvals = matplotlib.mlab.griddata(lon_old.ravel(), lat_old.ravel(), ivals.ravel(), lon_new, lat_new,interp='linear').T lat_old = array([ 19.62606908, 18.50457985, 17.38309053, 16.26160115, 15.14011169, 14.01862218, 12.8971326 , 11.77564298, 10.65415331, 9.53266359, 8.41117384, 7.28968406, 6.16819425, 5.04670442, 3.92521457, 2.8037247 , 1

How to plot dotted lines from a shapefile in python?

狂风中的少年 提交于 2019-12-11 00:30:15
问题 I am not sure on how to plot a dotted line from a shapefile in Python. It appears that readshapefile() does not have any linestyle for me to set. Below I have a working code where I take a shapefile and plot it, but it only plots a solid line. Any ideas to set me in the right direction? Thanks! The shapefile can be found here: http://www.natice.noaa.gov/products/daily_products.html, where the Start Date is Feb 15th, end date is Feb 17th, and the Date Types is Ice Edge. It should be the first

Python sum lat/lon points within geographic radius and sum to grid

℡╲_俬逩灬. 提交于 2019-12-10 21:19:57
问题 Basically, my experimental program is trying to find the number of points that fall within a (e.g., 50km) radius of a valid point at a given time. My data is structured (but I can restructure if need-be) in three separate arrays such: 1_LAT,1_LON,1_TIM Where 1_LAT,1_LON,1_TIM all contain roughly ~250 values corresponding to Latitude, Longitude (decimal degrees), and time respectively. I have 20 sets of these arrays (i.e., 1_LAT,1_LON,1_TIM...20_LAT,20_LON,20_TIM). Here is what I would like to

How to plot the field of view of an Earth-Observation satellite when close to the poles using basemap?

老子叫甜甜 提交于 2019-12-10 18:46:42
问题 I am trying to draw the maximum (theoretical) field of view of a satellite along its orbit. I am using Basemap, on which I want to plot different positions along the orbit (with scatter), and I would like to add the whole field of view using the tissot method (or equivalent). The code below works fine until the latitude reaches about 75 degrees North, on a 300km altitude orbit. Beyond which the code outputs a ValueError: "ValueError: undefined inverse geodesic (may be an antipodal point)"