Tagged Questions
1
vote
1answer
17 views
Inserting hyperlinks in pyplot interactive mode
I am creating a visualization of Twitter user locations as tweets come in, and so within my matplotlib code I have these three lines to create an interactive plot so the location markers can be ...
0
votes
1answer
23 views
Select starting color in matplotlib colormap
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 ...
0
votes
1answer
28 views
Labels with list in matplotlib
I'm plotting a handful of coordinates using two lists, x and y. I have a third list which is a list of labels. I want to apply the corresponding label to every (xᵢ,yᵢ) pair.
I'm plotting the ...
2
votes
0answers
77 views
Error importing basemap. KeyError: 'dap'
I am trying to import basemap and am getting the error below. I looked into the issue on stackoverflow and tried the suggestion provided here:
Why do I get "UserWarning: Module dap was already ...
1
vote
0answers
45 views
How to use set clipped path for Basemap polygon
I want to use imshow (for example) to display some data inside the boundaries of a country (for the purposes of example I chose the USA) The simple example below illustrates what I want:
import numpy ...
0
votes
0answers
28 views
How to plot data only within Basemap country region
For the code below, besides having the relevant modules installed, you will need to download and unpack the file "nationp010g.shp.tar.gz" that can be found here. This file is a shape file of the ...
0
votes
0answers
26 views
how can I interpolate vectors for oceanic currents plot using quiver and basemap
I have u,v data on a curvilinear grid. I managed to create a vector plot on a map but
since my grid is not linear the vectors are packed towards the center of the grid.
How can I interpolate my data ...
0
votes
1answer
48 views
Regridding regular netcdf data
I have a netcdf file containing global sea-surface temperatures. Using matplotlib and Basemap, I've managed to make a map of this data, with the following code:
from netCDF4 import Dataset
import ...
0
votes
1answer
50 views
Python matplotlib manual colormap
I have 2-d fields to plot in python using matplotlib basemap.
The values of the fields varies from 0 to more than 1000. Is it possible to create manual colormap with fixed gradations and colours? It ...
0
votes
1answer
37 views
Plotting multiple points instead of just one in Python
Not sure why it's not producing all of their points. Here is my code:
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
from mpl_toolkits.basemap ...
1
vote
1answer
44 views
Plotting on a BaseMap - unexpected result
I am running the following code, which should be basic basemap stuff:
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
#basic stuff from the examples
...
2
votes
1answer
698 views
Automatically center matplotlib basemap onto data
I would like a solution to automatically center a basemap plot on my coordinate data.
I've got things to automatically center, but the resulting area is much larger than the area actually used by my ...
0
votes
1answer
33 views
Basemap clipped in East-West Direction (not wrapping)
I have a global 2.5-degree data field (144,72) plotted on a basemap. I thought everything was working until I noticed that the map was not continuous in the E-W direction. The image is posted at
...
1
vote
1answer
47 views
Python real time varying heat map plotting
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 ...
1
vote
1answer
64 views
Force use of scientific style for basemap colorbar labels
String formatting can by used to specify scientific notation for matplotlib.basemap colorbar labels:
cb = m.colorbar(cs, ax=ax1, format='%.4e')
But then each label is scientifically notated with ...
1
vote
1answer
46 views
Drawing ellipses on matplotlib basemap projections-How to extend the basemap class
I am new to python and matplotlib (and stackoverflow). Can you please tell me how do I extend my basemap class with this ellipse function? The original post "Drawing ellipses on matplotlib basemap ...
-1
votes
1answer
58 views
Technology for visualization of geographical data. Python, matlab, Java [closed]
I am new to geographical data visualization, so I would like to ask if someone could recommend me some tool for easy visualization of data on map.
Particularly I have data from one European city and ...
11
votes
4answers
1k views
why does my colorbar have lines in it?
Does anyone know why my colorbar has what appear to be lines in it? Or rather why is the color transition not smooth? I'm using basemap, obviously, but that shouldn't matter since it's all matplotlib ...
0
votes
1answer
64 views
Plotting 2D satellite profile data in 3D over earth projection in Python
I am attempting to do something similar to this:
sample ozone profile
Not necessarily over an orthographic projection - a cube over a map would suffice.
I'm able to plot the PolyCollection object ...
0
votes
1answer
77 views
Convert to Web Mercator With Numpy
My program vertically stretches a Numpy array, representing a 180 by 360 map image, so it represents a Web Mercator map image.
I wrote a function (below) that does what I want - but it is crazy slow ...
0
votes
1answer
16 views
Matplotlib, corrupted graphical representation error
I have been developing a GUI using PyQt4 and within this GUI I implement a graph (via MatPlotLib. However, when I initially run the interface I get an error message that says something along the lines ...
0
votes
0answers
35 views
how to fix basemap on redhat 6.5
Apparently sometime between May 12th and Now a redhat 6.5 update broke basemap. Until very recently
from mpl_toolkits import basemap
worked as expected. Sometime between May 12th and now code that ...
1
vote
0answers
48 views
How to keep constant arrow scale with consecutive plots in matplotlib
I plan to draw a sequence of figures with Matplotlib, each consisting of the field of a certain time frame. I used quiver to generate vector graph, but I want to keep the vector scale to be constant ...
1
vote
1answer
64 views
Reduce the Size of Matplotlib Basemap
In various operational and manually-run Python scripts, I produce thousands of plots of California every day using matplotlib's Basemap:
mp = ...
7
votes
2answers
582 views
Python GUI from Java
I am working on a program which takes a user input and generates an output as a map projection plot.
The easiest map projection library that I have found is matplotlib-basemap, written in python a ...
3
votes
0answers
95 views
color matplotlib map using bicubic interpolation
I know that matplotlib and scipy can do bicubic interpolation:
http://matplotlib.org/examples/pylab_examples/image_interp.html
http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html
...
1
vote
2answers
335 views
Get PyInstaller to import Basemap
I'm working on building a standalone executable for a simple tool I built that uses Basemap. (Using Python 2.7, using the dev version of PyInstaller - 2.1). The .exe (single file) builds just fine, ...
1
vote
2answers
908 views
Trouble in installing Basemap in matplotlib
I am trying to install Basemap, and beforehand I already have the prerequisite versions of Matplotlib, Python and Numpy working on my Mac. To install Basemap I am following the instructions in this ...
1
vote
1answer
176 views
Pandas error with basemap/proj for map plotting
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 ...
1
vote
1answer
62 views
Matplotlib is not recognizing the attribute set_xdata.
In reference to this post: I have been attempting to run the following code for plotting and live updating a graph. However, I am welcomed by the following error every time I attempt to run the ...
0
votes
0answers
88 views
cx_freeze, mpl_toolkits/basemap/ how include the data folder in the build library.zip
I am struggling a lot trying to create a .exe for my Gui originaly coded with opensuse. I am trying to make the .exe for windows (under XP). cx_freeze seems to work better for my case. The build ...
-1
votes
1answer
35 views
Create a Student-Age graph in Python-Matplotlib
import matplotlib.pyplot as plt
x = ['Eric','Jhon','bill','Daniel']
y = [10, 17, 12.5, 20]
plt.plot(x,y)
plt.show()
When I run this code, I get this error
ValueError: could not convert string to ...
0
votes
0answers
21 views
Delete marker after plotting on Basemap and re-plot again
I have a listbox and every list have some points to be plotted.
Everytime I choose one of the listbox I want to plot the points on Basemap.
Here's the code when I choose the listbox:
def ...
3
votes
2answers
988 views
Basemap on the face of a matplotlib.mplot3d cube
As the title suggests, I'm trying to plot a Basemap map on the z=0 surface of a matplotlib.mplot3d lineplot. I know the Axes3D object is capable of plotting on the z=0 surface (via Axes3D.plot, ...
0
votes
0answers
19 views
Basemap Objects in 3D
Using Basemap in a 3D, calls such as
ax.add_collection3d(m.drawcoastlines(linewidth=0.25))
work but calls with fill such as
ax.add_collection3d(m.drawmapboundary(fill_color='blue'))
do not work.
...
1
vote
1answer
94 views
Runtime error using python basemap and pyproj?
I wrote a script using Spyder IDE with mpl_toolkits basemap to plot a GPS track as arrows for direction colored by speed. Everything worked fine until I upgraded pandas to 0.13.
The data is like ...
0
votes
1answer
264 views
How do I animate a scatterplot over a basemap in matplotlib?
The code below generates a animated basemap, but not exactly the one I want: I want the scatterplot from the previous frame to disappear, but it persists through the remainder of the animation.
I ...
0
votes
1answer
150 views
How to plot an irregular spaced RGB image using python and basemap?
Given that I have three matrices which describe the data that I want to plot:
lons - 2D matrix with [n_lons,n_lats]
lats - 2D matrix with [n_lons,n_lats]
dataRGB - 3D matrix with [n_lons,n_lats,3]
...
0
votes
1answer
144 views
Scatter plot in basemap python
Using basemap and matplotlib, I am plotting a large number of points (lat, long) that is suppose to form a line on the globe.
Is there anyway to replace the dot with an arrow, and have the arrow ...
0
votes
0answers
52 views
Plotting stack.interpolate output after masking on a basemap using pcolormesh
I presently plotting using interpolate the scattered magnitude points on a basemap in Python, after I interpolate , i get the nan values in my list output fromt the interpolate, I tried to mask it ...
0
votes
1answer
98 views
Basemap and numpy 2d array
I have some physical data in raster as a numpy array (electromagnetic field density). I know latitude, longitude of its corners and pixel size. I know how to combine my raster with Basemap plot by ...
9
votes
4answers
2k views
OSError geos_c could not be found when Installing Shapely
I'm a newbie to making/plotting on maps with python, been trying to follow this blogpost to generate a world map ...
-1
votes
1answer
48 views
Interactively get readable(i.e. lng/lat) coordinates from a matplotlib basemap plot?
I'm doing matplotlib basemap plots. The current coordinates of the mouse pointer are interactively displayed in the lower right area of the figure. But they are in map coordinates (I assume). I would ...
1
vote
2answers
106 views
Is it possible to control matplotlib marker orientation?
I would like to know if I have a triangular marker, is it possible to control its orientation? I have a series of facets, with their corresponding vertices, and I would like to plot a basemap of them. ...
0
votes
1answer
220 views
Mapping with Shapely Polygons
I am at a loss to get the following code to work. For whatever reason, the GeoPandas *.plot() doesn't work, but I want to use both Pandas and GeoPandas for some simple plots.
I have been trying to ...
0
votes
2answers
728 views
matplotlib mouseclick event in pie chart
Is there a way in matplotlib and Python to return the value/label clicked in a pie chart. For example if user clicks on sliver A of pie chart, return value A. If user clicks on sliver B of B pie ...
1
vote
1answer
145 views
plt.savefig(): ValueError: All values in the dash list must be positive
Running the code at the below link results in the error. As far as having something to do with the image, I don't know what the 'dash list' is.
matplotlib.pyplot as plt
...
...
0
votes
0answers
23 views
Plot Azmuth Angle In Basemap
I'm wondering if there is a way to plot azimuth angles projections from an off surface object (ie. a satellite) in python. I'm currently using Basemap, is there some method or maybe another library I ...
2
votes
1answer
246 views
Animation of pcolormesh() with mpl_toolkit.basemap giving attribute error
I am trying to animate some density data on a basemap map. Following an approach as was done in [this SO question][1], I get the following error:
...
2
votes
2answers
103 views
Resample grid from center coordinates to external (i.e. corner) coordinates
Is there a readily available method for extrapolating the grid corner positions (blue dots) from grid center positions (red dots)?
The grid I am working with is not rectangular, so regular bi-linear ...