[Matplotlib-users] NaN's when projecting via Basemap instance

2015-05-05 Thread Seb
Hello,

I noticed that a Basemap instance yields 1e30 when projecting lat/lon
NaN coordinates.  In the following, nav is a pandas data frame with
navigation coordinates:

  llcrnrlon=np.round(np.min(nav['longitude']))
  llcrnrlat=np.round(np.min(nav['latitude']))
  urcrnrlon=np.round(np.max(nav['longitude']))
  urcrnrlat=np.round(np.max(nav['latitude']))
  lat_0=(llcrnrlat + urcrnrlat) / 2
  lon_0=(llcrnrlon + urcrnrlon) / 2
  lat_1=llcrnrlat + ((urcrnrlat - llcrnrlat) / 6)
  lat_2=urcrnrlat - ((urcrnrlat - llcrnrlat) / 6)
  m=Basemap(projection="aea", lon_0=lon_0, lat_0=lat_0,
lat_1=lat_1, lat_2=lat_2, width=600, height=500,
resolution="h")
  x, y = m(nav['longitude'].values, nav['latitude'].values)

Wherever the coordinates are NaN in the nav object, Basemap projects
them to 1e30 in x and y.  Is this a bug in my Debian sid python 2.7.9
version?

Thanks,

-- 
Seb


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Visulization of orthogonal grid

2015-05-05 Thread GoogleWind
Dear all,

Matplotlib currently support the visuliaztion of triangular mesh and
square-cell map. Is there any solutions to support the visulization of
orthogonal grid as follows,
 

Thanks in advances for your hints.

Best regards,
Jiacong Huang
---
Nanjing Institute of Geography & Limnology
Chinese Academy of Sciences
73 East Beijing Road, Nanjing 210008, China
Tel./Fax: +86-25-86882127
Homepage: http://www.escience.cn/people/elake/index.html




--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Visulization-of-orthogonal-grid-tp45473.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] issue with wireframe-plot

2015-05-05 Thread diffracteD
Hi.
  I am using matplotlib to plot a wireframe over a 3D list data I have.

X = [2.06, 2.07, 2.14, 2.09, 2.2, 2.05, 1.92, 2.06, 2.11, 2.07, 2.15, 2.29,
2.06, 2.09, 2.19, 2.19, 2.26, 2.15,  2.15, 2.06, 2.29, 2.27, 2.46, 2.2,
2.01, 2.11, 2.03, 2.1, 2.17, 2.1]
Y = [171.82, 170.8, 159.59, 164.28, 169.98, 162.23, 167.37, 173.81, 166.66,
155.13, 156.56, 156.78, 158.15, 163.31, 150.97, 133.91, 142.36, 152.48,
138.6, 153.88, 155.13, 146.09, 147.84, 167.9, 161.82, 168.39, 163.73,
164.03, 169.33, 159.42]
Z = [-1.41173660883, -1.26977354468, -1.07436015752, -1.07522326036,
-1.46114949754, -0.955999769503, -0.0826570511052, -1.25171489428,
-1.2005961876, -0.862264432276, -1.27266152624, -1.55152901892,
-0.93658603, -1.2470594709, 0.40793102312, -1.5375122067,
-1.02404937182, -1.38113558714, -0.842054259969, -0.908694881796,
-1.57965851609, -1.35631827259, -2.0568110654, -0.783657274668,
-0.329844805297, -1.37033049146, -0.853410578988, -1.47048937914,
-1.65570962873, -1.21419612238]

I am trying to plot it using:

`
*data = np.c_[cumualtive_dist,cumulative_ang,cumulative_energ]

# regular grid covering the domain of the data...
mn = np.min(data, axis=0)
mx = np.max(data, axis=0)
X,Y = np.meshgrid(np.linspace(mn[0], mx[0], 50), np.linspace(mn[1],
mx[1], 50)) 
XX = X.flatten()
YY = Y.flatten()

# best-fit quadratic curve
A = np.c_[np.ones(data.shape[0]), data[:,:2], np.prod(data[:,:2],
axis=1), data[:,:2]**2]
C,_,_,_ = scipy.linalg.lstsq(A, data[:,2])

# evaluate it on a grid
Z = np.dot(np.c_[np.ones(XX.shape), XX, YY, XX*YY, XX**2, YY**2],
C).reshape(X.shape)

# Plot scatter-points and fitted 3D surface
#-
fig3 = plt.figure(figsize=(10,6))
ax3 = fig3.gca(projection='3d')
surf = ax3.plot_surface(X, Y, Z, rstride=1, cstride=1, alpha=0.5,
cmap=cm.jet)

#Adding a color-bar...
fig3.colorbar(surf, shrink=0.6, aspect=6)
#ax3.plot_wireframe(X, Y, Z, rstride=1, cstride=1, alpha=0.4)
ax3.scatter(data[:,0], data[:,1], data[:,2], c='r', s=5)

ax3.set_zlim3d(-5, 5)   #Limiting Z-axis... *
`
This code is giving a plot looks like(shown below):
 

But I was looking for a fitted-graph somewhat-looks like(however not
exactly) this: 
 

I mean the stretching-of-thread appearance w.r.t. distribution of points,
I'm not being able to get such things in mine. 



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/issue-with-wireframe-plot-tp45474.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users