Re: [Matplotlib-users] How can I visualize a landscape which I have sample heights of?

2015-06-25 Thread Ian Thomas
The mplot3d tutorial page, which is the first result when you google 'mplot3d', includes a section on 'Tri-surface plots' and is precisely what you are looking for. You certainly do not need to use scipy. Matplotlib includes its own Delaunay triangulator, as specified in the 'triangular grids' do

Re: [Matplotlib-users] How to plot other than rectangular grid?

2014-11-22 Thread Ian Thomas
Masha, As suggested before, take a look at the triangular mesh functions. There are simple contour ( http://matplotlib.org/examples/pylab_examples/tricontour_demo.html) and pcolor plots ( http://matplotlib.org/examples/pylab_examples/tripcolor_demo.html), plus linear and cubic interpolation ( htt

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-04 Thread Ian Thomas
On 2 November 2014 16:30, Benjamin Root wrote: > Would it make sense to at least emit a warning when a mask is encountered. > There are very few places in matplotlib where masked arrays are not allowed > (I think histograms is the other spot, but I can't remember for sure). > Ben, That's certai

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-02 Thread Ian Thomas
On 1 November 2014 18:20, Hartmut Kaiser wrote: > Thanks Ian! Your detailed answer is much appreciated. > > As you might have already guessed, we have quite some problems creating > clean geometries from the generated contour data. I have tried to put > together one (reasonably) small test case i

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-10-26 Thread Ian Thomas
On 26 October 2014 00:18, Hartmut Kaiser wrote: > At this point we assume, that polys[0] is a linear ring to be interpreted > as > a polygon exterior and polys[1:] are the corresponding interiors for > polys[0]. > > Here are our questions: > > Is this assumption correct? > Is there any detailed d

Re: [Matplotlib-users] Crash when using matplotlib.tri.LinearTriInterpolator

2014-08-12 Thread Ian Thomas
sumes less RAM would be preferable. There are various possibilities, they just have to be implemented! I will take a look at it sometime, but it probably will not be soon. Ian T

Re: [Matplotlib-users] Crash when using matplotlib.tri.LinearTriInterpolator

2014-08-11 Thread Ian Thomas
o generate the netCDF file. I would normally expect the code to work but produce useless output. A crash is possible though. It would be best if you could post a link to the netCDF file and I will take a closer look to check there is not something else going wrong. Ian Thomas ---

Re: [Matplotlib-users] Bug in contourf or BoundaryNorm?

2014-03-28 Thread Ian Thomas
On 28 March 2014 12:56, Jesper Larsen wrote: > I believe the normalization behaviour is wrong for contourf at least when > using a BoundaryNorm. In the script below I am using the same norm to plot > the same data using contourf and pcolormesh. The color should change around > an x value of 0.15

Re: [Matplotlib-users] Plotting NOAA grib2 data in basemap

2014-01-29 Thread Ian Thomas
On 29 January 2014 03:21, Eric Firing wrote: > On 2014/01/28 10:01 AM, A Short wrote: > > Hi - Ive now improved my code and confirmed the use of the right grib > file > > but i cant for the life of me figure out the missing data near the > > coastline..? Could anyone help? > > The present contour

Re: [Matplotlib-users] Limiting interpolation of map plot with tricontourf

2013-11-01 Thread Ian Thomas
On 1 November 2013 13:55, Jule wrote: > Hey guys, > > I have a question regarding my plot. > > I want to plot seaice thickness distribution. The data is derived from a > model run using an unstructured grid. To plot data on a map I

Re: [Matplotlib-users] Build failure

2013-10-28 Thread Ian Thomas
On 26 October 2013 09:02, Nils Wagner wrote: > The problem persists in master. > > > > On Fri, Aug 30, 2013 at 7:39 PM, Nils Wagner wrote: > >> You are right. >> The first one fails, the second works for me. >> >> >> Nils >> >> >> >> On Fri, Aug 30, 2013 at 7:20 PM, Michael Droettboom wrote: >> >

Re: [Matplotlib-users] bisecting triangulation

2013-07-02 Thread Ian Thomas
On 1 July 2013 13:40, zetah wrote: > Hi, > > I have set of points in a plane and make triplot: > > subplot(121) > plot(points[:,0], points[:,1], 'o') > title('Set of points') > subplot(122) > triplot(points[:,0], points[:,1]) > title('Triangulation') > > result: http://i.i

Re: [Matplotlib-users] Plotting 2D Structured CFD Grids and contour plots

2013-03-31 Thread Ian Thomas
On 29 March 2013 20:15, Jeff Layton wrote: > Good afternoon, > > I'd like to be able to plot some 2D Structured CFD meshes > and contour plots (pressure, etc) using Matplotlib. I've > googled a little but does anyone have any pointers or > links to help get me started? > > Thanks! > > Jeff > The

Re: [Matplotlib-users] griddata fails

2013-01-09 Thread Ian Thomas
On 9 January 2013 09:32, Shahar Shani-Kadmiel wrote: > Hi, > > I'm trying to contour some data that I have and the griddata line fails. I > tried running it on some synthetically generated data and I get the same > IndexError. Any Ideas? > > Here is the example with the synthetic data: > > x = y =

Re: [Matplotlib-users] Gap when using contourf and nan's

2012-11-17 Thread Ian Thomas
On 16 November 2012 15:38, Bror Jonsson wrote: > > Oh, I left out a line in the code, very sorry for that. Here is a full > example: > > import numpy as np > import pylab as pl > > #Generate a matrix populated with 1's > fld = np.ones((4,4)) > #Set one corner of the matrix to NaN > fld[:2,:2] = n

Re: [Matplotlib-users] Gap when using contourf and nan's

2012-11-15 Thread Ian Thomas
sson > Hello Bror, It is not clear from your code snippets exactly what you are asking for. Please can you post a full runnable example? Ian Thomas -- Monitor your physical, virtual and cloud infrastructure from a single w

Re: [Matplotlib-users] Clipping Contours

2012-10-17 Thread Ian Thomas
On 16 October 2012 18:44, T J wrote: > > This is a set of 152 points on a triangle. delaunay is mentioned to > have problems for some pathological cases. Is a complete triangular > grid considered as such a case? > Yes, under certain circumstances! delaunay is not 'geometrically robust', mean

Re: [Matplotlib-users] [matplotlib-devel] Bug in Triangulation causes infinite loop if 4 or more duplicate points are used in tricontour()

2012-04-17 Thread Ian Thomas
On 16 April 2012 23:36, Damon McDougall wrote: > On Monday, 16 April 2012 at 16:34, Kacper Kowalik wrote: > > > On 16 Apr 2012 22:31, "Damon McDougall" wrote: > > > > Hi Kacper, > > > > Just to be clear, is it tri.Triangulation(x, y) that hangs, or is it > plt.tricontour(…)? > > It's plt.tricont

Re: [Matplotlib-users] Hardware rendering with tricontourf

2012-01-27 Thread Ian Thomas
ends currently available that use hardware rendering. There has been some work done on an OpenGL backend, but I am not sure of the status of this. The last time I checked it was pretty experimental. Perhaps someone involved with it can comment o

Re: [Matplotlib-users] Triangulations and Polar Plots

2011-11-15 Thread Ian Thomas
On 15 November 2011 00:18, Daniel Welling wrote: > Greetings. > > I recently found myself in the position of needing to plot polar, > irregularly spaced data. I've done similar using regularly spaced values > with no problem. However, I've found that when the points become greatly > scattered,

Re: [Matplotlib-users] Triangulation objects

2011-11-14 Thread Ian Thomas
On 13 November 2011 19:10, Daniel Welling wrote: > I am interested in accessing Triangulation objections that are created by > MPL for tricontour-type plots. The docs for MPL routines that use > triangulation objects refer to documentation, but none exists in the MPL > online docs. Does anyone

Re: [Matplotlib-users] Inner boundaries in tricontourf

2011-08-31 Thread Ian Thomas
hed a modified version of your debug.py to show this. This may be simpler to use than points_inside_poly, but if you have multiple nested boundaries it could get confusing unless you know which boundary encloses which others. Ian Thomas import matplotlib import matplotlib.pyplot as plot import num

Re: [Matplotlib-users] Inner boundaries in tricontourf

2011-08-31 Thread Ian Thomas
the inner/outer-ness of each boundary from such an algorithm but it would be overkill for what you want to do. Ian Thomas -- Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution

Re: [Matplotlib-users] Change color for fill_between to contour plot

2011-07-09 Thread Ian Thomas
Try tricontourf; I've attached an example. Most of the example code is manipulating your input data and calculating the connectivity of your grid. I hope this helps, Ian Thomas import matplotlib.pyplot as plt import numpy as np x,y1,y2,y3,y4,stress = np.loadtxt('data.txt', skipro

Re: [Matplotlib-users] Boundary edges of a set of points

2011-04-29 Thread Ian Thomas
On 28 April 2011 22:56, Luke wrote: > I am thinking that perhaps the approach I should be taking should > involve contouring the real part of the eigenvalues which determine > the stability, and then plot the zero-level curve. I'll have to think > about that some more. > This sounds like a very

Re: [Matplotlib-users] Boundary edges of a set of points

2011-04-28 Thread Ian Thomas
estions, please post your example code as it is much easier for others on the mailing list to correct existing code than come up with their own freestanding example. I hope some of this helps! Ian Thomas import matplotlib.pyplot as plt import matplotlib.tri as tri import numpy as np #

Re: [Matplotlib-users] pyplot: Extract contourset without plotting

2011-01-27 Thread Ian Thomas
Daniel, Following on from Eric's comments, attached is the simplest example I could come up with to do what you want. For non-filled contours, the 'segs' (last few lines of the file) should be fairly self-explanatory, and this is hopefully what you want. If you are after filled contours, you wil

Re: [Matplotlib-users] mplot3d - ploting 3d triangular mesh model - need help

2010-11-11 Thread Ian Thomas
On 11 November 2010 12:41, isolat wrote: > > hi all, > please is there any one can tell me if it's possible in mplot3d to plot 3d > triangular mesh model with a colormap different from the Z variable. I > don't find example in tutorial for this. > thanks. > No, this is not possible. Support fo

Re: [Matplotlib-users] Problems using triplot from file

2010-09-27 Thread Ian Thomas
On 27 September 2010 15:37, radfahrer wrote: > I am trying to plot a triangular grid from a textfile using triplot, but > all > I get is some wired straight line > Your triangulation consists of just two triangles, the first with vertices (0, 0) (0.1, 0.1) (0.1, 0.1) and the second (0, 0), (0.1,

Re: [Matplotlib-users] Plotting 3D, Irregularly Triangulated Surfaces - An Example

2010-09-20 Thread Ian Thomas
On 17 September 2010 16:26, Simon S. Clift wrote: > I have a data set that is in the form of an irregular 2D grid with > associated values, one for each node. I would like to plot this as a > raised surface, with colours that indicate the z-value. Somehow I > didn't find just quite the example

Re: [Matplotlib-users] contour's polygons

2010-07-29 Thread Ian Thomas
On 28 July 2010 01:31, Phil Rosenfield wrote: > I'd like to use the polygons contour makes but I can't figure out how > to get them from ContourSet. Any examples or links to helpful > information would be excellent. > Attached is an example of how to extract the polygons from a ContourSet. import

Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-15 Thread Ian Thomas
Chris Barker wrote: > hmm -- I wonder if a post to matplotlib-devel is in order. Most of those > folks are on this list, to, but may not be following this thread. I'll post to matplotlib-devel shortly and see what response I get. > By the way, it sounds like your contouring code is in C++ -- is

Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-11 Thread Ian Thomas
Chris Barker wrote: > ... ... To summarise, you recommend the following units of functionality: 1) Triangulation class to wrap existing delaunay code. 2) Separate the storage of and creation of contour sets so that you can create your own. 3) tricontour and tricontourf functions to contour a Tri

Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-10 Thread Ian Thomas
Chris Barker wrote: > I think it would be great to have in MPL. > > What code are you using for the triangulation? Does it do constrained > delauney? My code only does the contouring; you have to input the triangulation. In the examples included with the code I used matplotlib.delaunay to do the

Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-09 Thread Ian Thomas
Hello all, I submitted some code to matplotlib-users last September to perform contouring of triangular grids. The posts and code can be found at: http://sourceforge.net/mailarchive/forum.php?thread_name=4AB3B95B.3090903%40noaa.gov&forum_name=matplotlib-users Like I wrote at the time, if it is

[Matplotlib-users] Contouring on triangular grids

2009-09-18 Thread Ian Thomas
time polishing it. If it turned out that a (much improved) version of it was considered good enough to incorporate into mpl, I'd would happily help as I'd like to contribute. I hope someone finds it useful! Ian Thomas mpl_tri.tar.gz D