matplotlib-basemap

'AxesSubplot' object has no attribute 'get_axis_bgcolor'

这一生的挚爱 提交于 2019-12-21 22:40:28
问题 I am trying to run Basemap examples from here and I am facing an error 'AxesSubplot' object has no attribute 'get_axis_bgcolor'. When I try first example from the site I should receive contours black, water blue and land coral, but in my case boundaries are black but both water and land are blue I am using: -Python 3.5.5 -Matplotlib 2.2.2 Would appreciate any help. 回答1: Basemap (even current latest version 1.0.7) is using deprecated Matplotlib command (see: matplotlib.org/api/_as_gen/…). This

Matplotlib Streamplot for Unevenly (curvilinear) Grid

橙三吉。 提交于 2019-12-21 21:01:27
问题 I'm trying to plot streamlines on curvilinear grid an I'm getting error, with this end: /usr/local/lib/python2.7/dist-packages/matplotlib/streamplot.pyc in streamplot(axes, x, y, u, v, density, linewidth, color, cmap, norm, arrowsize, arrowstyle, minlength, transform) 100 101 ## Sanity checks. --> 102 assert u.shape == grid.shape 103 assert v.shape == grid.shape 104 AssertionError: I did the matplotlib examples and it is working well. How can I plot streamlines to this grid? The code is down

How to animate matplotlib's drawgreatcircle function?

本小妞迷上赌 提交于 2019-12-21 04:25:27
问题 I have created a small program which takes an NHL city and then draws the path the team travels throughout their season. The resulting graphic is messy: So I got the idea that it would be interesting if I animated the flight paths, sort of like watching an Indiana Jones movie, where the line grows from one point to another. My understanding from looking at other matplotlib samples is that the animation function takes in a function, calculates it's output, and then updates the graphic. I don't

Python Basemap: Error using shadedrelief, bluemarble or etopo (false longitude format?)

假装没事ソ 提交于 2019-12-20 04:18:24
问题 I want to plot a map of the southern hemisphere centered on the pacific with some stuff drawn onto it with python matplotlib basemap. Everything works fine unless I try to draw a background image with the basemap routines shadedrelief, bluemarble or etopo. The code (without the stuff i want to draw onto the map) looks like this: import numpy as np from mpl_toolkits.basemap import Basemap from matplotlib.backends.backend_pdf import PdfPages latmin = -72.5 latmax = 40. lonmin = 60. lonmax = 370

Python Basemap: Error using shadedrelief, bluemarble or etopo (false longitude format?)

戏子无情 提交于 2019-12-20 04:18:12
问题 I want to plot a map of the southern hemisphere centered on the pacific with some stuff drawn onto it with python matplotlib basemap. Everything works fine unless I try to draw a background image with the basemap routines shadedrelief, bluemarble or etopo. The code (without the stuff i want to draw onto the map) looks like this: import numpy as np from mpl_toolkits.basemap import Basemap from matplotlib.backends.backend_pdf import PdfPages latmin = -72.5 latmax = 40. lonmin = 60. lonmax = 370

Python: copy basemap or remove data from figure

情到浓时终转凉″ 提交于 2019-12-20 04:04:12
问题 I want to use a basemap figure as a background and plot things ontop. As the generation of the basemap figure (a polar stereographic plot) is quite time intensive I only want to do this once. The second step would be to draw some wind barbs on this plot and some other wind barbs on the same plot, but without the first set of barbs. Now either I copy the background image and then draw two different images or I can remove the first set of barbs and then draw the second, I don't mind which way

Pandas error with basemap/proj for map plotting

a 夏天 提交于 2019-12-20 02:57:11
问题 I ran the Python code below that is an example of "Plotting Maps: Visualizing Haiti Earthquake Crisis Data" on a book, Python for Data Analysis . Page 242-246 The code is supposed to create a plot map of Haiti but I got an error as below: Traceback (most recent call last): File "Haiti.py", line 74, in <module> x, y = m(cat_data.LONGITUDE, cat_data.LATITUDE) File "/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 1148, in __call__ xout,yout = self.projtran(x,y

Orthographic projection Python

不羁岁月 提交于 2019-12-19 11:54:08
问题 I use orthographic projection to plot maps. I use this programm: from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt import os, sys from sys import argv import pylab from mpl_toolkits.basemap import Basemap, shiftgrid from matplotlib import mpl from matplotlib import rcParams import matplotlib.pyplot as plt import matplotlib.mlab as mlab import matplotlib.patches as patches import matplotlib.path as path import matplotlib.dates as dt from numpy import

How to create a reusable basemap

微笑、不失礼 提交于 2019-12-19 03:13:44
问题 In continuation to my previous question: How to superimpose figures in matplotlib i would like to know how can one create a reusable basemap object. My problem is that a basemap is not a pyplot object, so the solution i received works well on figures / axes but not on basemap objects. I tried to look around and find a solution, but couldn't find any, just discussions. 回答1: Thanks to @JoeKington here and @EdSmith at How to superimpose figures in matplotlib, i was able to understand how to

Python real time varying heat map plotting

牧云@^-^@ 提交于 2019-12-18 18:11:33
问题 I have a 2D grid 50*50. For each location I have an intensity value(i.e data is like (x,y,intensity) for each of those 50*50 locations). I would like to visualize the data as a heatmap. The twist is that every second the intensity will change(for most of the locations), which means I will need to re-draw the heatmap every second. I am wondering what is the best library/approach to handle this kind of real-time varing heatmap. 回答1: This really depends on how you get your data, but: import