Martin Mokrejs | 23 May 2013 16:51
Picon

scatter_hist.py: broken Example on MPL website

Hi,
  I just hit a broken example at
http://matplotlib.org/examples/pylab_examples/scatter_hist.html?highlight=scatter

$ python  scatter_hist.py
Traceback (most recent call last):
  File "scatter_hist.py", line 44, in <module>
    axHisty.hist(y, bins=bins, orientation='horizontal')
  File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 8180, in hist
    color=c, bottom=bottom)
TypeError: barh() got multiple values for keyword argument 'bottom'
$

I have mpl-1.2.1.

Hope this helps.
Martin

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
Bakhtiyor Zokhidov | 23 May 2013 07:27
Picon

contourf() for "proper plotting purpose"

Hi,

I have following code:

import numpy as np
import pylab as pl

Matrix(10,10) = 

np.array([[ 4.5, 4.5, 4.5, 3.4, 2.5, 3.9, 3.4, 3.4, 2.2, 3.9],
[ 3.9, 4.5, 5.2, 4.5, 3.4, 3.4, 2.2, 2.9, 3.4, 3.4],
[ 3.9, 3.9, 2.5, 2.2, 1.9, 1.2, 1.2, 1.4, 2.5, 2.9],
[ 3.4, 3.9, 2.9, 2.2, 1.2, 1.4, 1.7, 1.4, 1.9, 2.2],
[ 2.5, 3.4, 2.2, 1.4, 1.2, 1.2, 1.7, 0.8, 1.9, 1.7],
[ 2.5, 2.2, 2.5, 1.2, 1.2, 0.9, 1.7, 1.7, 1.4, 1.9],
[ 2.2, 2.2, 3.4, 1.7, 0.9, 0.9, 0.9, 1.2, 1.7, 1.9],
[ 2.9, 1.9, 1.9, 1.4, 1.1, 0.9, 1.2, 1.1, 1.7, 1.9],
[ 2.9, 1.7, 2.2, 1.4, 1.1, 0.9, 1.1, 0.8, 1.1, 1.9],
[ 2.5, 1.9, 1.7, 1.2, 1.4, 0.8, 1.1, 0.8, 1.4, 1.7]])

pl.contourf(Matrix)
pl.show()

The problem is that that plots reversely, in other words top values are below, bottom values are top!!

How can I plot it properly?


--
Bakhtiyor Zokhidov
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
oyster | 22 May 2013 17:06
Picon

why legend does not show in matplotlib-1.2.1 & py2.7

the following code runs ok with py2.4 and matplotlib.0.98.3
however no legend appears with py2.7.3 and matplotlib-1.2.1/1.3. and I get
[quote]
e:\prg\py\python-2.7.3\lib\site-packages\_matplotlib\matplotlib\legend.py:629: U
serWarning: Legend does not support [<matplotlib.patches.Wedge object at 0x03842
0F0>, <matplotlib.patches.Wedge object at 0x03842530>, <matplotlib.patches.Wedge
 object at 0x03842930>, <matplotlib.patches.Wedge object at 0x03842D30>, <matplo
tlib.patches.Wedge object at 0x038B0150>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  (str(orig_handle),))
e:\prg\py\python-2.7.3\lib\site-packages\_matplotlib\matplotlib\legend.py:629: U
serWarning: Legend does not support [<matplotlib.text.Text object at 0x03842310>
, <matplotlib.text.Text object at 0x03842750>, <matplotlib.text.Text object at 0
x03842B50>, <matplotlib.text.Text object at 0x03842F50>, <matplotlib.text.Text o
bject at 0x038B0370>]
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

  (str(orig_handle),))
[/quote]

what's the matter? thanks

[code]
#coding=utf-8
from pylab import *

val2010 = [2, 10, 20, 15, 3]

figure()

pie2010=pie(val2010, labels=[u'%i persons' % i for i in val2010])

plt.legend( (pie2010), [u'<60', u'60~70', u'70~80', u'80~90',
u'90~100'], loc = 'best', bbox_to_anchor = (0.90, 0.75) )
axis('equal')

show()
[/code]

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
Gregorio Bastardo | 22 May 2013 16:48
Picon

constrained rectangular zoom does not always work with Qt4 backend

Hi,

I have problems with constrained rectangular zoom to x-y axis with
PyQt4 / PySide backend. When I use the "Zoom-to-rectangle" button of
the navigation toolbar while holding the x or y key, sometimes nothing
happens when the mouse is released. Constrained panning and
pan-zooming ("Pan/Zoom" button) works well.

I used the following dummy code to set up the environment:

import numpy as np
import matplotlib as mpl
if mpl.get_backend() != 'Qt4Agg':
  mpl.use('Qt4Agg')
  # mpl.rcParams['backend.qt4']='PySide'
  # mpl.rcParams['backend.qt4']='PyQt4'
import matplotlib.pyplot as plt
x = np.linspace(0,1)
y = np.random.rand(x.size)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x,y)
plt.show()

Looking at the mail archives and the issue tracker gave me no relevant
result. Has anyone experienced a similar issue?

python 2.7.4 win32
matplotlib 1.1.1 and 1.2.1
PyQt4 QtCore 4.8.3
PySide QtCore 4.8.3
PySide 1.1.2

Thanks,
Gregorio

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
ChaoYue | 21 May 2013 22:21
Picon

Re: Is it possible to truncate axes in matplotlib?

Hi Mat,

this has been asked before. see here:
http://matplotlib.1069221.n5.nabble.com/quot-zig-zag-quot-to-represent-suppressed-0-on-axis-td40849.html#a40858

cheers,

Chao

On Mon, May 20, 2013 at 8:29 PM, mat [via matplotlib] <[hidden email]> wrote:
Dear community,

I would like to truncate the x axis of a plot, as in the attached figure:

 Is it possible to do so ?

Best,
Mat

If you reply to this email, your message will be added to the discussion below:
http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092.html
To start a new topic under matplotlib - users, email [hidden email]
To unsubscribe from matplotlib, click here.
NAML



--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************

View this message in context: Re: Is it possible to truncate axes in matplotlib?
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Jim St.Cyr | 20 May 2013 19:27
Picon

Basemap & PyPlot - How clip & color?

I'm using Basemap to display the East Coast of the US and the Atlantic Ocean.  
Shapefile is used to read a shapefile the contents of which is loaded into a 
PyPlot subplot hosted Line Collection which overlays the ocean with a series of 
closed polygons.  PyPlot text is used to label each polygon with it's designator.

I have two questions both of which involve the polygons I'm loading from the 
shapefile.

1.) In order to simplify polygon\shoreline intersections the sides of the 
polygons were brought onto shore to close the polygon.  How do I make these 
lines not show up on the land portion of the basemap?  I tried zorder but it 
didn't seem to make a difference.

2.) Is there a way to color fill the polygons being created in the LineCollection?

Thank you for the assist.  PNG available by PM if needed.

Jim

import shapefile

import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib import cm
from mpl_toolkits.basemap import Basemap

fig = plt.figure(figsize=(11.7,8.3))
#Custom adjust of the subplots
plt.subplots_adjust(left=0.05,right=0.95,top=0.90,bottom=0.05,wspace=0.15,hspace=0.05)
ax = plt.subplot(111)
#Let's create a basemap of the Northeast Region
x1 = -78.
x2 = -64.
y1 = 34.
y2 = 46.

m = Basemap(resolution='i',projection='merc', 
llcrnrlat=y1,urcrnrlat=y2,llcrnrlon=x1,urcrnrlon=x2,lat_ts=(x1+x2)/2)
m.drawcountries(linewidth=0.5,zorder = 10)
m.drawcoastlines(linewidth=0.5,zorder = 11)
m.drawstates(linewidth=0.5,zorder = 12)
##m.drawrivers(linewidth=0.5)
m.fillcontinents(color='coral')

sf = 
shapefile.Reader("c:\\temp\\US_Stat_Areas_no_Coastline\\US_Stat_Areas_no_Coastline")
shapeRecs = sf.shapeRecords()

centroids = []

for area in shapeRecs:
     shpsegs = []
     shpinfo = []
     points = []

     stat_area = area.record[0]

     if int(stat_area) > 700:
         continue
     else:
         if int(stat_area) <= 463:
             continue
         else:
             pass

     print "Processing Stat Area: %s" % stat_area
     vertices = area.shape.points
     lons = []
     lats = []

     for each_vertice in vertices:
         lons.append(each_vertice[0])
         lats.append(each_vertice[1])
         x, y = m(lons, lats)
         shpsegs.append(zip(x,y))

         shpseg = zip(x,y)
         for point in shpseg:
             points.append(Point(point[0],point[1]))

     lines = LineCollection(shpsegs,antialiaseds=(1,),zorder = 5)
     lines.set_edgecolors('k')
     lines.set_linewidth(0.3)

     ax.add_collection(lines)

plt.savefig('test_plot.png',dpi=300)

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
Martin Mokrejs | 20 May 2013 18:02
Picon

Making space for a long legend outside of a barchart

Hi,
  I am having trouble to get space allocated for a long legend text,
lets say spanning 2/3 - 3/4 of the whole output. I would like to have
stacked barchart as 1st subplot and the place of remaining 3 subplots
to be actually allocated by the legend. Alternatively, could I get the
legend saved into a separate figure?

Or could the space for legend text be allocated automatically minimizing
output figure size? For example, the width would be 1120px while height
be multiples of 840px (840 for each subplot)?

  Attached is a quick example. It shows also that I tried tight_layout()
but wasn't successful with this either. I would be glad for some help,
ideally converting the whole thing into an object-oriented approach.
I am generating several figures in a row and would like to clear()/del()
any previously used data ASAP.

Thank you,
Martin
Am using mpl-1.2.2
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Mark Budde | 18 May 2013 07:26
Picon

Arrows with circular curvature

I am trying to draw plasmid maps in matplotlib. This requires drawing arrows with a circular curvature (see here for example http://www.encyclon.net/docs/plasmidmap/images/ex6.gif). However, when I try to curve the arrows, for instance using this example (http://matplotlib.org/api/artist_api.html#matplotlib.patches.ArrowStyle), I can only get parabolic type curves, not circular curves. Can someone who understands this a little better help me out with a simple example?
Thanks,
Mark
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Florian M. Wagner | 17 May 2013 23:19
Picon

Pick artist in PolyCollection

Dear matplotlib users,

is it possible to pick an individual artist (Polygon) within a 
PolyCollection?

Cheers, Florian

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
blueone | 16 May 2013 20:41
Picon

Matplotlib gray area around plot

Hi,

I am working on my first project involving Matplotlib. I haven't used it
much, but i'm already impressed by it!
The project i am working on uses Matplotlib embedded in wxPython. I have
already embedded it successfully, but there is one thing that i would still
like to change and that is the gray area around the plot. The background of
the plot is white and around it there's this thick gray rectangle. Is there
a way of making it smaller?

Thanks in advance!

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-gray-area-around-plot-tp41073.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
Gregorio Bastardo | 16 May 2013 16:25
Picon

legend marker update problem

Hi,

I've recently come accross an issue when working on an interactive
marker toggling callback. The problem is illustrated below:

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
line, = ax.plot(range(10), range(10))
# uncomment next line to reproduce bug
# line.set_marker('d')
legend = ax.legend([line], ['foo'])
legend_line, = legend.get_lines()
fig.show()
raw_input('press enter to clear marker')
line.set_marker('')
legend_line.set_marker('')
fig.canvas.draw()
raw_input('press enter to set marker')
line.set_marker('d')
legend_line.set_marker('d')
fig.canvas.draw()
raw_input('press enter to exit')

So when I add a line object to the legend *without marker*, the update
works fine both on data and legend line, but *with marker* it does not
refresh the legend line. I consider it as a bug, please tell me if I'm
doing something wrong.

python 2.7.4 win32
matplotlib 1.2.1

Thanks,
Gregorio

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d

Gmane