I interpolated temperature data observed on an urban area formed by 12 locations. Now i would like to remove all interpolated values that are outside the shapefile layer. How can i do it? The shapefile links: https://www.dropbox.com/s/0u76k3yegvr09sx/LimiteAMG.shp?dl=0 https://www.dropbox.com/s/yxsmm3v2ey3ngsp/LimiteAMG.cpg?dl=0 https://www.dropbox.com/s/yx05n31dfkggbb6/LimiteAMG.dbf?dl=0 https://www.dropbox.com/s/a6nk0xczgjeen2d/LimiteAMG.prj?dl=0 https://www.dropbox.com/s/royw7s51n2f0a6x/LimiteAMG.qpj?dl=0 https://www.dropbox.com/s/7k44dcl1k5891qc/LimiteAMG.shx?dl=0 The Data is: Lat Lon T 0 20.8208 -103.4434 22.0 1 20.7019 -103.4728 21.9 2 20.6833 -103.3500 24.2 3 20.6280 -103.4261 NaN 4 20.7205 -103.3172 25.7 5 20.7355 -103.3782 24.0 6 20.6593 -103.4136 NaN 7 20.6740 -103.3842 25.0 8 20.7585 -103.3904 23.0 9 20.6230 -103.4265 NaN 10 20.6209 -103.5004 20.0 11 20.6758 -103.6439 26.8 12 20.7084 -103.3901 24.4 …

Member Avatar
Member Avatar
+0 forum 1

I am struggling to get the following code to work in Python 3. from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection import matplotlib.pyplot as plt fig = plt.figure() ax = Axes3D(fig) x = [0,1,1,0] y = [0,0,1,1] z = [0,1,0,1] #verts = [zip(x, y,z)] verts = list(zip(x, y, z)) ax.add_collection3d(Poly3DCollection(verts)) plt.show() The next to last line gives the following error: TypeError: zip argument #1 must support iteration How do I fix this?

Member Avatar
Member Avatar
+0 forum 2

Let's say I have a 10X10 array that is a multiplication table, multiplied times some arbitrary integer constant. For this example, pretend that constant is 5. So the first row would be 5, 10, ..., 45, 50; the second row would be 10, 20, ..., 90, 100; etc. When doing a color plot, matplotlib numbers both axes by the index number, not the value contained therein. So how would I get this graph to have scales of 10n X 10n, not 10X10, using matplotlib?

Member Avatar
+0 forum 0

#! /usr/bin/python import numpy as np data = np.loadtxt('path-tracks.csv',dtype=np.str,delimiter=',',skiprows=1) print data [['19.70' '-95.20' '2/5/04 6:45 AM' '1' '-38' 'CCM'] ['19.70' '-94.70' '2/5/04 7:45 AM' '1' '-48' 'CCM'] ['19.30' '-93.90' '2/5/04 8:45 AM' '1' '-60' 'CCM'] ['19.00' '-93.50' '2/5/04 9:45 AM' '1' '-58' 'CCM'] ['19.00' '-92.80' '2/5/04 10:45 AM' '1' '-50' 'CCM'] ['19.20' '-92.60' '2/5/04 11:45 AM' '1' '-40' 'CCM'] ['19.90' '-93.00' '2/5/04 12:45 PM' '1' '-43' 'CCM'] ['20.00' '-92.80' '2/5/04 1:15 PM' '1' '-32' 'CCM'] ['23.10' '-100.20' '30/5/04 4:45 AM' '2' '-45' 'SCME'] ['23.20' '-100.00' '30/5/04 5:45 AM' '2' '-56' 'SCME'] ['23.30' '-100.00' '30/5/04 6:45 AM' '2' '-48' 'SCME'] ['23.30' …

Member Avatar
Member Avatar
+0 forum 2

When I try to save a pylab plot (either from the GUI or with `pylab.savefig`), I get the error at the bottom. A minimal script that demonstrates the problem is: import pylab pylab.savefig("foo.png") A Google search for `IndexError: Unexpected SeqBase<T> length` did produce some results, none of them hinting how to solve the problem. I run the latest pylab (matplotlib version 1.1.0) with Python 2.6.8 on CygWin (CYGWIN_NT-6.1 1.7.17(0.262/5/3)). *Anyone knows how to get `pylab.savefig` to work?* $ python demonstrate_Unexpected_SeqBase_error.py Traceback (most recent call last): File "demonstrate_Unexpected_SeqBase_error.py", line 2, in <module> pylab.savefig("foo.png") File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 471, in savefig return fig.savefig(*args, …

Member Avatar
+0 forum 0

A simple physics graph... [code=python]import pylab a_time = range(0,141,10) a_R = [3.0,2.8,2.56,2.36,2.2,2.0,1.86,1.7,1.6,1.43,1.3,1.2,1.1,1.06,0.96] for i in range(0,15): pylab.plot(a_time[i],a_R[i], 'x') pylab.errorbar(a_time[i], a_R[i], 0.5, 0.05) pylab.show() [/code] I'm guessing the [icode]pylab.plot[/icode] line isn't needed, but even with this there is nothing connecting the plots together. I'm pretty sure there wasn't anything extra needed when i tried this out on another machine. Here's an image: [URL="http://i51.tinypic.com/v77gjb.jpg"]http://i51.tinypic.com/v77gjb.jpg[/URL] or check the attachment EDIT: Oh and i'm running Ubuntu 9.10 with matplotlib installed through the software centre So basically what I want is a line joining the plots, either i'm being really stupid or there are some …

Member Avatar
Member Avatar
+0 forum 1

Heya Daniweb, I've been working on Regular Expressions, thanks to cghtkh who told me about them. I've used resources from: [URL="Newthinktank.com"]NewThinkTank.com[/URL] [URL="http://docs.python.org/library/re.html"]Python Regular Expression Documentation[/URL] and [URL="daniweb.com"]Daniweb.com[/URL]! I figured I'd share my code, ask a few questions, and get some feedback on what I did if I can. Feedback helps me improve my programming skills, Hopefully I won't be a pest to anyone. [CODE] import re #Imports the Regular Expression Library f = open('randomcharacters.txt') #Opens "randomcharacters.txt" from same directory as the script lineToSearch = "" for line in f: lineToSearch += line #Goes through all the lines in the data …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone.. I'm new to python, the more to matplotlib :( and I am hoping that I can get help from this community... :) I have a .csv file, first column is a time stamp with format HH:MM:SS, next 8 columns are values of different parameters. I want to plot each parameter against the time it is taken, in this case, against the time as indicated by the time stamp... How do I convert the time stamp into something which is can be understood by matplotlib? please help me on this... :) Thank you!

Member Avatar
Member Avatar
+0 forum 8

The End.