Re: [Matplotlib-users] Pyplot contour plot - clabel padding

2014-12-05 Thread Sappy85
Hi Jody,

what exactly du you mean - the plot windows size?

I tried this:
fig = plt.figure(figsize=(8.4,5.76))

But still the same problem.

Regards 



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Pyplot-contour-plot-clabel-padding-tp44554p44557.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Patch + facecolors

2014-12-05 Thread Diego Avesani
Dear matplotlib users,

I would like to know if there is in matplotlib the following Matlab
function:

*p=patch(x(TRI'),y(TRI'),u(TRI'),u(TRI'));*

*set(p,'FaceColor','interp','EdgeColor','black');*

where TRI are the coordinate of many non regular rectangles.

I would like to do that because I have a not-structured grid whose elements
are irregular rectangles. I would like to plot a 3D surface of the values
on each points of the grid.

Thanks in advance to everyone
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pyplot contour plot - clabel padding

2014-12-05 Thread Jody Klymak
I meant plt.xlim and plt.ylim.  But its hard to tell what the problem is w/o 
some sample code.

Cheers,   Jody

 On Dec 5, 2014, at  1:07 AM, Sappy85 robert.wittk...@gmx.de wrote:
 
 Hi Jody,
 
 what exactly du you mean - the plot windows size?
 
 I tried this:
 fig = plt.figure(figsize=(8.4,5.76))
 
 But still the same problem.
 
 Regards 
 
 
 
 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Pyplot-contour-plot-clabel-padding-tp44554p44557.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.
 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pyplot contour plot - clabel padding

2014-12-05 Thread Sappy85
Hi Jody,

i have posted the code. Here again:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import pygrib

filename   = file.grib2
grbs   = pygrib.open('/data/' + filename)
grb= grbs[2]
data   = grb.values
datac  = data*0.01
lats, lons = grb.latlons()

fig = plt.figure()
m = Basemap(projection='stere',lon_0=5,lat_0=90.0,\
   
llcrnrlon=-25.0,urcrnrlon=60.0,llcrnrlat=30.0,urcrnrlat=60.0,resolution='l')

x, y = m(lons, lats)

levs = range(940,1065,5)
S1=plt.contour(x,y,datac,levs,linewidths=0.5,colors='b')
plt.clabel(S1,inline=1,inline_spacing=0,fontsize=8,fmt='%1.0f',colors='b')

m.drawmapboundary(fill_color='w')
m.drawcoastlines(linewidth=0.2)

plt.savefig('test.png', bbox_inches='tight',pad_inches=0.05, dpi=100) 

Regards,
Sappy85



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Pyplot-contour-plot-clabel-padding-tp44554p44561.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Patch + facecolors

2014-12-05 Thread Benjamin Root
I am a bit confused. Your variable is TRI, but you keep saying
rectangles. You are also referring to unstructured rectangles, which makes
zero sense to me. Do you mean triangles?

If you, matplotlib has the tri- family of functions and a whole module
devoted to triangulation-related tasks:
http://matplotlib.org/api/tri_api.html
http://matplotlib.org/examples/pylab_examples/tricontour_demo.html

Even the mplot3d toolkit has (limited) support:
http://matplotlib.org/examples/mplot3d/trisurf3d_demo.html

I hope that helps!
Ben Root


On Fri, Dec 5, 2014 at 11:38 AM, Sappy85 robert.wittk...@gmx.de wrote:

 Hi diedro,

 try something like this:

 import matplotlib.patches as patches
 import matplotlib.pyplot as plt

 fig= plt.figure()
 ax= fig.add_subplot(111)
 verts = [0.2,0.8], [0.1,0.5], [0.7,0.1]
 poly  = patches.Polygon(verts, ec='r', fc='g')

 ax.add_patch(poly)
 plt.show()

 http://matplotlib.1069221.n5.nabble.com/file/n44560/help3.png

 or this:

 import numpy as np
 import matplotlib
 matplotlib.use('Agg')

 from matplotlib.patches import Polygon
 from matplotlib.collections import PatchCollection
 import matplotlib.pyplot as plt

 fig, ax = plt.subplots()

 patches = []
 x   = np.random.rand(3)
 y   = np.random.rand(3)

 for i in range(3):
 polygon = Polygon(np.random.rand(3,2), True)
 patches.append(polygon)


 colors = 100*np.random.rand(len(patches))
 p = PatchCollection(patches, cmap=matplotlib.cm.jet, alpha=0.4)
 p.set_array(np.array(colors))
 ax.add_collection(p)
 plt.colorbar(p)
 plt.grid()
 plt.savefig('/var/www/img/help2.png', bbox_inches='tight',pad_inches=0.05)

 http://matplotlib.1069221.n5.nabble.com/file/n44560/help2.png

 Regards,
 Sappy85




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Patch-facecolors-tp44558p44560.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE

 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Patch + facecolors

2014-12-05 Thread Sappy85
Hi diedro,

try something like this:

import matplotlib.patches as patches
import matplotlib.pyplot as plt

fig= plt.figure()
ax= fig.add_subplot(111)
verts = [0.2,0.8], [0.1,0.5], [0.7,0.1]
poly  = patches.Polygon(verts, ec='r', fc='g')

ax.add_patch(poly)
plt.show()

http://matplotlib.1069221.n5.nabble.com/file/n44560/help3.png 

or this:

import numpy as np
import matplotlib
matplotlib.use('Agg')

from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

patches = []
x   = np.random.rand(3)
y   = np.random.rand(3)

for i in range(3):
polygon = Polygon(np.random.rand(3,2), True)
patches.append(polygon)


colors = 100*np.random.rand(len(patches))
p = PatchCollection(patches, cmap=matplotlib.cm.jet, alpha=0.4)
p.set_array(np.array(colors))
ax.add_collection(p)
plt.colorbar(p)
plt.grid()
plt.savefig('/var/www/img/help2.png', bbox_inches='tight',pad_inches=0.05)

http://matplotlib.1069221.n5.nabble.com/file/n44560/help2.png 

Regards, 
Sappy85




--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Patch-facecolors-tp44558p44560.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Key events using nbagg backend

2014-12-05 Thread Joe Kington
Woops! You're absolutely right! I was completely confused!

I mixed up the new nbagg backend with the way ipython notebooks used to
display matplotlib figures.  The nbagg backend is indeed interactive (and I
have no idea why key press callbacks aren't supported, then).

This is what happens when I reply to e-mail without putting much thought
into it.

Thanks!
-Joe

On Thu, Dec 4, 2014 at 8:58 PM, Brendan Barnwell brenb...@brenbarn.net
wrote:

 On 2014-12-04 15:40, Joe Kington wrote:
  Nbagg is non-interactive, similar to Agg. No events other than draw
 events
  are supported, as far as I know.

 If that's the case, the release notes should probably make that
 clear.
   Right now at
 http://matplotlib.org/users/whats_new.html#the-nbagg-backend it says:
 Phil Elson added a new backend, named “nbagg”, which enables
 interactive figures in a live IPython notebook session.  The word
 interactive certainly could lead people to believe that the backend
 is, in fact, interactive.

 --
 Brendan Barnwell
 Do not follow where the path may lead.  Go, instead, where there is no
 path, and leave a trail.
 --author unknown


 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE

 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users