Re: [Matplotlib-users] [matplotlib-devel] License, freetype

2017-02-18 Thread Paul Hobson
Especially on Windows, I always install freetype from conda.
-p

On Sat, Feb 18, 2017 at 6:24 AM, CAB <cabr...@yahoo.com> wrote:

> Hi, Gents,
>
> Many thanks for your thoughtful responses!  Freetype is indeed available
> under a BSD-like licensse.  But when I tried to install freetype on my
> Windows system using the binary provided from GnuWin32, it attempts to
> force me to accept the GPL3, which I cannot.  Freetype's link to another
> binary supplied by GTK+ is broken.  So, I guess I have two choices; compile
> freetype from the source, or download something like Anaconda, which I'd
> rather not do because I have Python already installed.
>
> If you have any other ideas, I'd be happy to hear them.
>
> Best,
> Chad
>
>
> --
> *From:* Joe Kington <joferking...@gmail.com>
> *To:* Paul Hobson <pmhob...@gmail.com>
> *Cc:* CAB <cabr...@yahoo.com>; Matplotlib Development List <
> matplotlib-de...@lists.sourceforge.net>; Matplotlib Users <
> matplotlib-users@lists.sourceforge.net>
> *Sent:* Friday, February 17, 2017 5:03 PM
> *Subject:* Re: [matplotlib-devel] [Matplotlib-users] License, freetype
>
> Well, if Freetype were only distributed under the GPL, you couldn't
> distribute matplotlib in binary form without providing the source code.
>
> However, Freetype is distributed under more than one license.  (see:
> https://www.freetype.org/license.html )
>
> Because it's distributed under a BSD-style license in addition to the GPL,
> it can be distributed in binary form, subject to an accreditation clause:
> http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT
>
> In the past, I have gotten approval from corporate lawyers at a very large
> company to use freetype (and matplotlib) in an application that was being
> distributed in binary form.  The dual-licensing of freetype was key in that
> particular case.
>
> Or that's my take on it, anyway.  I'm not a Lawyer, so don't consider this
> legal advice in any way.
> Cheers!
> -Joe
>
> On Fri, Feb 17, 2017 at 4:52 PM, Paul Hobson <pmhob...@gmail.com> wrote:
>
> Chad,
>
> My recollections is that matplotlib doesn't distribute the source code to
> FreeType, it only uses it as a dependency. As such, MPL is in the clear
> with its more permissive licensing.
> -Paul
>
> On Fri, Feb 17, 2017 at 12:45 PM, CAB <cabr...@yahoo.com> wrote:
>
> Hi, All,
>
> I just went to install matplotlib version 2.0.0, and it has a dependency
> called "freetype". This software appears to be licensed under GPL3.  My
> reading of that latter license is that, if someone wanted to distribute a
> compiled version of a program requiring matplotlib, that entire program
> would fall under the GPL3 license.  I'm sure that would be a non-starter
> for many, many projects.
>
> Does anyone have any takes on this?
>
> Chad
>
> -- --
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> __ _
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourcef orge.net
> <Matplotlib-users@lists.sourceforge.net>
> https://lists.sourceforge.net/ lists/listinfo/matplotlib-user s
> <https://lists.sourceforge.net/lists/listinfo/matplotlib-users>
>
>
>
>
> -- --
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
> __ _
> Matplotlib-devel mailing list
> Matplotlib-devel@lists. sourceforge.net
> <matplotlib-de...@lists.sourceforge.net>
> https://lists.sourceforge.net/ lists/listinfo/matplotlib- devel
> <https://lists.sourceforge.net/lists/listinfo/matplotlib-devel>
>
>
>
>
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] License, freetype

2017-02-17 Thread Paul Hobson
Chad,

My recollections is that matplotlib doesn't distribute the source code to
FreeType, it only uses it as a dependency. As such, MPL is in the clear
with its more permissive licensing.
-Paul

On Fri, Feb 17, 2017 at 12:45 PM, CAB  wrote:

> Hi, All,
>
> I just went to install matplotlib version 2.0.0, and it has a dependency
> called "freetype". This software appears to be licensed under GPL3.  My
> reading of that latter license is that, if someone wanted to distribute a
> compiled version of a program requiring matplotlib, that entire program
> would fall under the GPL3 license.  I'm sure that would be a non-starter
> for many, many projects.
>
> Does anyone have any takes on this?
>
> Chad
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] subplot layout

2016-04-26 Thread Paul Hobson
Viridis is in the `cm` submodule.

from matplotlib import cm
cmap = cm.viridis

On Mon, Apr 25, 2016 at 6:24 PM, Sudheer Joseph <sudheer.jos...@yahoo.com>
wrote:

> Hi Paul,
>
> I tried to get the new colormap suggestion from you but could not get the
> colormap package. Where can I get it? google search did not took me to the
> package/
> Is it a development package?
>  May I know how to use  viridis color map  with an example plot?
>
>
> Below is an example code from the link you send
>
> '''
> For each colormap, plot the lightness parameter L* from CIELAB colorspace
> along the y axis vs index through the colormap. Colormaps are examined in
> categories as in the original matplotlib gallery of colormaps.
> '''
>
> from colormaps import cmaps
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib import cm
> import matplotlib as mpl
> from colorspacious import cspace_converter
>
>
>
> *** Sudheer
> Joseph Indian National Centre for Ocean Information Services
> Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla
> P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:
> +91-40-23886047(O),Fax:+91-40-23895011(O), 
> Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
> E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com Web-
> http://oppamthadathil.tripod.com
> *******
>
> 
> On Mon, 25/4/16, Paul Hobson <pmhob...@gmail.com> wrote:
>
>  Subject: Re: [Matplotlib-users] subplot layout
>  To: "Sudheer Joseph" <sudheer.jos...@yahoo.com>
>  Cc: "Matplotlib Users" <matplotlib-users@lists.sourceforge.net>
>  Date: Monday, 25 April, 2016, 4:33 PM
>
>  Your
>  basemap plot is likely setting the aspect of the axes to
>  "equal", so it resizes the plot accordingly.
>  Otherwise you'd have a pretty nasty amount of vertical
>  distortion.
>  When you save
>  the figure, using bbox_inches='tight' will trim the
>  excess white space from the
>  margins:fig.savefig('map_and_bars.png',
>  dpi=600, bbox_inches='tight')
>  Also, you should try the new viridis
>  color map :)
> http://matplotlib.org/users/colormaps.html?highlight=colormaps#miscellaneous
>
>
>
>  On Mon, Apr 25, 2016 at
>  9:05 AM, Sudheer Joseph <sudheer.jos...@yahoo.com>
>  wrote:
>  Hi,
>
> I am looking for a layout as seen in the
>  empty layout attached which is produced using
>
>  figsize(20,8),subplot(1,2,1);subplot(222);subplot(224)
>
>
>
>  However when I use it for getting attached second figure the
>  layout gets modified as seen in attached figure 2.
>
>  fig = p.figure(figsize=(20,8))
>
>  ax=p.subplot(121)
>
>  ax1=p.subplot(222)
>
>  ax2=p.subplot(224)
>
>
>
>  Can any one suggest a way to get figure exactly as the empty
>  layout?
>
>
>
>  With best regards,
>
>  Sudheer
>
>
>
>  ***
>  Sudheer Joseph Indian National Centre for Ocean
>  Information Services Ministry of Earth Sciences, Govt. of
>  India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi
>  Nagar,Kukatpally, Hyderabad; Pin:5000 55
>  Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
>  Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
> E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com
>  Web- http://oppamthadathil.tripod.com
>  ***
>
>  
> --
>
>  Find and fix application performance issues faster with
>  Applications Manager
>
>  Applications Manager provides deep performance insights into
>  multiple tiers of
>
>  your business applications. It resolves application problems
>  quickly and
>
>  reduces your MTTR. Get your free trial!
>
>  https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>  ___
>
>  Matplotlib-users mailing list
>
>  Matplotlib-users@lists.sourceforge.net
>
>  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] subplot layout

2016-04-25 Thread Paul Hobson
Your basemap plot is likely setting the aspect of the axes to "equal", so
it resizes the plot accordingly. Otherwise you'd have a pretty nasty amount
of vertical distortion.

When you save the figure, using bbox_inches='tight' will trim the excess
white space from the margins:
fig.savefig('map_and_bars.png', dpi=600, bbox_inches='tight')

Also, you should try the new viridis color map :)
http://matplotlib.org/users/colormaps.html?highlight=colormaps#miscellaneous



On Mon, Apr 25, 2016 at 9:05 AM, Sudheer Joseph 
wrote:

> Hi,
>I am looking for a layout as seen in the empty layout attached
> which is produced using
> figsize(20,8),subplot(1,2,1);subplot(222);subplot(224)
>
> However when I use it for getting attached second figure the layout gets
> modified as seen in attached figure 2.
> fig = p.figure(figsize=(20,8))
> ax=p.subplot(121)
> ax1=p.subplot(222)
> ax2=p.subplot(224)
>
> Can any one suggest a way to get figure exactly as the empty layout?
>
> With best regards,
> Sudheer
>
> *** Sudheer
> Joseph Indian National Centre for Ocean Information Services
> Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla
> P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
> Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
> Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
> E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com Web-
> http://oppamthadathil.tripod.com
> ***
>
> --
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] register colormap collection

2015-10-01 Thread Paul Hobson
On Thu, Oct 1, 2015 at 9:40 AM, Thomas Caswell  wrote:

> Have a look at how cmocean (https://github.com/matplotlib/cmocean) works
> under the hood.
>
> I think the options are:
>- use a module to supply your color maps (from my_cmap_collection
> import my_cmap) and then pass those objects through to the functions
>- have your module call the register code on import (or on calling a
> helper function which call the registration code) so that you can simply
> pass the string name through and `get_cmap` will do the right thing.
>
> Tom
>

FWIW -- this second option is exactly what I do for custom colormaps and
Axes scales.
https://github.com/Geosyntec/wqio/blob/master/wqio/utils/__init__.py#L10
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] boxplot behaviour in an extreme scenario

2015-08-26 Thread Paul Hobson
Are you running python 2 or python 3? If you're on python 2, what happens
if you add from __future__ import division to the top of your script?

On Tue, Aug 25, 2015 at 10:31 PM, chtan ch...@unisim.edu.sg wrote:

 Hi,

 the outliers in the boxplot do not seem to be drawn in the following
 extreme
 scenario:
 Data Value: 1, Frequency: 5
 Data Value: 2, Frequency: 100
 Data Value: 3, Frequency: 5

 Here, Q1 = Q2 = Q3, so IQR = 0.
 Data values 1 and 3 are therefore outliers according to the definition in
 the api
 (Refer to parameter whis under boxplot:
 http://matplotlib.org/api/pyplot_api.html
 http://matplotlib.org/api/pyplot_api.html  )

 But the code below produces a boxplot that shows them as max-min whiskers
 (rather than fliers):

 import matplotlib.pyplot as plt
 data = 100 * [2] + 5 * [1] + 5 * [3]
 ax = plt.gca()
 bp = ax.boxplot(data, showfliers=True)
 for flier in bp['fliers']:
 flier.set(marker='o', color='gray')

 http://matplotlib.1069221.n5.nabble.com/file/n46027/figure_1.png


 What I though it would look like is obtained by perturbing half of the data
 points 2 to 2.01:

 http://matplotlib.1069221.n5.nabble.com/file/n46027/figure_2.png


 Is this a bug or I'm not getting something right?

 rgds
 marcus



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/boxplot-behaviour-in-an-extreme-scenario-tp46027.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] boxplot behaviour in an extreme scenario

2015-08-26 Thread Paul Hobson
Your perturbed and unperturbed scenarios draw the same figure on my machine
(mpl v1.4.1).

The reason why you don't get any outliers is the following:
Boxplot uses matplotlib.cbook.boxplot_stats under the hood to compute where
everything will be drawn. If you look in there, you'll see this little
nugget:

# interquartile range
stats['iqr'] = q3 - q1
if stats['iqr'] == 0:
whis = 'range'


When whis = 'range', the whiskers fall back to extending to the min an max.
So that is at least the intent of the code. Open to a different
interpretation of what should be happening, though.

On Wed, Aug 26, 2015 at 1:08 AM, Paul Hobson pmhob...@gmail.com wrote:

 Are you running python 2 or python 3? If you're on python 2, what happens
 if you add from __future__ import division to the top of your script?

 On Tue, Aug 25, 2015 at 10:31 PM, chtan ch...@unisim.edu.sg wrote:

 Hi,

 the outliers in the boxplot do not seem to be drawn in the following
 extreme
 scenario:
 Data Value: 1, Frequency: 5
 Data Value: 2, Frequency: 100
 Data Value: 3, Frequency: 5

 Here, Q1 = Q2 = Q3, so IQR = 0.
 Data values 1 and 3 are therefore outliers according to the definition in
 the api
 (Refer to parameter whis under boxplot:
 http://matplotlib.org/api/pyplot_api.html
 http://matplotlib.org/api/pyplot_api.html  )

 But the code below produces a boxplot that shows them as max-min whiskers
 (rather than fliers):

 import matplotlib.pyplot as plt
 data = 100 * [2] + 5 * [1] + 5 * [3]
 ax = plt.gca()
 bp = ax.boxplot(data, showfliers=True)
 for flier in bp['fliers']:
 flier.set(marker='o', color='gray')

 http://matplotlib.1069221.n5.nabble.com/file/n46027/figure_1.png


 What I though it would look like is obtained by perturbing half of the
 data
 points 2 to 2.01:

 http://matplotlib.1069221.n5.nabble.com/file/n46027/figure_2.png


 Is this a bug or I'm not getting something right?

 rgds
 marcus



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/boxplot-behaviour-in-an-extreme-scenario-tp46027.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] boxplot behaviour in an extreme scenario

2015-08-26 Thread Paul Hobson
Even though I'm familiar with the boxplot source code, I largely use
IPython for quick investigations like this.

In IPython, doing something like matplotlib.Axes.boxplot?? shows the full
source code for that functions\.

Then I saw/remembered that boxplot now just calls
matplotlib.cbook.boxplot_stats and passes the results to
matplotlib.Axes.bxp.

So then I did matplotlib.cbook.boxplot_stats to see how the whiskers were
computed.
-paul

On Wed, Aug 26, 2015 at 8:43 PM, chtan ch...@unisim.edu.sg wrote:

 Uh, now I understand why it's behaving this way. Tx Paul.

 From the documentation, it seems natural to expect the behaviour to be
 uniform throughout the meaningful range for IQR.

 How may I go about searching for the responsible code on my own in
 situations like this?
 From the perplexing behaviour to the little nugget in
 matplotlib.cbook.boxplot_stats, the path isn't clear to me.

 Any general advice?



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/boxplot-behaviour-in-an-extreme-scenario-tp46027p46032.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] @image_comparison decorator and unittests

2015-07-30 Thread Paul Hobson
Fabien,

The @image_comparison operator is still somehwat of a black box for me. But
I can confirm your observation that it only works on top-level test
functions, not within a class.

It's on my long, and slowly shifting backlog of things to try to improve.
-paul


On Thu, Jul 30, 2015 at 6:47 AM, Jens Nielsen jenshniel...@gmail.com
wrote:

 Thomas Robitailles  pytest image comparison plugin might also be of
 interest
 https://github.com/astrofrog/pytest-mpl

 Jens

 tor. 30. jul. 2015 kl. 14.43 skrev Thomas Caswell tcasw...@gmail.com:


 Paul Hobson expressed interest in making it easier to use the image
 comparison tests out side of the mpl test suite

 Tom

 On Thu, Jul 30, 2015, 9:28 AM Fabien fabien.mauss...@gmail.com wrote:

 Hi all,

 is it possible to use the @image_comparison decorator for tests
 generated within a unittest.TestCase class?

 With my attempts so far the decorator was indeed instanicated at run
 time but the test was not called, i.e. the test would allways pass...
 Running the test with decorator from outside the class works fine.

 Any idea? Thanks,

 Fabien



 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Misleading BoundaryNorm error

2015-07-29 Thread Paul Hobson
On Wed, Jul 29, 2015 at 3:18 AM, Fabien fabien.mauss...@gmail.com wrote:

 Folks,

 still in my exploring phase of Matplotlib's ecosystem I ran into
 following mismatch between the APIs of BoundaryNorm and Normalize.

 See the following example:

 import matplotlib as mpl
 c = mpl.cm.get_cmap()
 bnorm = mpl.colors.BoundaryNorm([0,1,2], c.N)
 nnorm = mpl.colors.Normalize(0, 2)

 # This works:
 In [8]: c(nnorm(1.1))
 Out[8]: (0.64199873497786197, 1.0, 0.32574320050600891, 1.0)

 # This doesn't:
 In [9]: c(bnorm(1.1))
 (...)
 TypeError: 'numpy.int16' object does not support item assignment

 # But this works:
 In [10]: c(bnorm([1.1]))
 Out[10]: array([[ 0.5,  0. ,  0. ,  1. ]])

  From the doc I would expect BoundaryNorm and Normalize to work the same
 way. I find the error sent by BoundaryNorm quite misleading.

 Should I fill a bug report for this?


Fabien,

What happens if your force the boundaries to floats? By that I mean:
bnorm = mpl.colors.BoundaryNorm([0.0, 1.0, 2.0], c.N)
-Paul
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Produce KML from Matplolib

2015-06-21 Thread Paul Hobson
Eric,

You'll be producing the KML from pythonor some other python package. GIS
I/O is well beyond matplotlib's scope.

This gis,stackexchange thread seems promising:
http://gis.stackexchange.com/questions/22519/create-a-ground-overlay-kml-from-georeferenced-raster


On Wed, Jun 10, 2015 at 1:07 AM, egayer ega...@ipgp.fr wrote:

 Hi all,

 Is there a way to produce a KML file from matplolib results as R and Matlab
 do ?

 - plotKML is a R package http://plotkml.r-forge.r-project.org
 - Matlab has the Google Earth Toolbox.

 Both of them allow to plot directly on GE

 I' have been digging around and found this old post :Producing a
 KML-friendly (Google Earth) image but nothing about how to actually a
 matplolib result as a KML file useable into Google Earth.

 I have seen some shape to KML packages, but nothing about raster.

 The ultimate goal being to use the plot, mplot3d, imshow, etc... to plot
 any python array on GE.

 Thanks for your help
 Eric





 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Produce-KML-from-Matplolib-tp45759.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] custom x axis integers boxplot

2015-06-16 Thread Paul Hobson
You want to use a MultipleLocator:
http://matplotlib.org/examples/pylab_examples/major_minor_demo1.html

-paul

On Mon, Jun 15, 2015 at 6:16 PM, pb89 peterbehrin...@gmx.de wrote:

 hey guys, is it also possible to only show every 5th number of that array?
 Its a little too much right now:
 
 http://matplotlib.1069221.n5.nabble.com/file/n45784/computationTime_slicer4_final.png
 



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45784.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] custom x axis integers boxplot

2015-06-13 Thread Paul Hobson
Oh sorry that should be ... positions=np.arange(11, 36))


On Sat, Jun 13, 2015 at 7:49 AM, pb89 peterbehrin...@gmx.de wrote:

 it tried this before, but it throws an exception:

 TypeError: boxplot() got an unexpected keyword argument 'pos'





 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45774.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] custom x axis integers boxplot

2015-06-13 Thread Paul Hobson
Probably a better way would be to the the pos arguments to boxplot
(bp=boxplot(array,
pos=range(11, 36)). That *should* work. Let me know if it doesn't.

On Fri, Jun 12, 2015 at 4:36 PM, pb89 peterbehrin...@gmx.de wrote:

 thanks for the quick answer Jeffrey, its working!

 -peter



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45771.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap Problems

2015-06-08 Thread Paul Hobson
Edgar,

You feed lat/lon (float) values. See this example here:
http://matplotlib.org/basemap/users/cea.html

And a whole collection of setting up maps in other projection here:
http://matplotlib.org/basemap/users/mapsetup.html

You also need to make sure that all of inputs make sense together (e.g.,
you're not specifying any corners beyond the range of your specific
projection)
-p

On Mon, Jun 8, 2015 at 10:49 AM, Ronquillo, Edgar Nahum eronqui...@lanl.gov
 wrote:

  Hello,
 I am currently working with Basemap to plot a shapefile on the map.
 However, I am confused on how to initialize llcrnrx and llcrnry and same
 for the upper corner. I currently have both latitudes and longitudes for
 lower and upper corners in degrees. Does this mean I have to convert from
 degrees to x,y coordinates? I tried using llcrnrlon and llcrnrlat but it
 doesn't seem to like this. Please help me clarify this, any help would be
 great.

 Thank You


 --

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] for Posterior predictive data distributions

2015-06-07 Thread Paul Hobson
(apologies if the list receives this twice)

On Fri, Jun 5, 2015 at 9:14 AM, Juan Wu wujua...@gmail.com wrote:

 Hi, Experts,

 My colleagues and I have a question, how we can make a plot via python
 like below. According to a guy's original paper, Each panel shows the
 normalized histograms of the observed data (bar plots) and the model
 prediction (black lines) .

 I believe that people can make it with Matplotlib. Any code suggestion
 (with simple example data) would be much appreciated.

 (I am more comfortable with Matlab, but now the python code is preferred).

 J



Juan,

It is, of course, very difficult to give any concrete advice without
knowing how your data are stored.

In any case, seaborn builds on matplotlib to provide some very advanced
visualization with a very concise API.

I recommend you look into the seaborn.distplot function and
seaborn.FacetGrid class.
http://web.stanford.edu/~mwaskom/software/seaborn/

-Paul
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-05 Thread Paul Hobson
On Fri, Jun 5, 2015 at 9:17 AM, Jody Klymak jkly...@uvic.ca wrote:



 Anyways, I guess I am advocating trying to find a colormap with a very
 obvious central hue to represent zero.  Anomaly data sets are *very*
 common, so having a default colormap that doesn’t do something reasonable
 with them may be a turn off to new users.


Personally, I disagree. I think that sequential colormaps make better
defaults b/c then the software isn't making an assumptions about the
central tendency of your data.

You raise a good point though. Perhaps a compromise is to make sequential
and diverging valid arguments to any function that takes cmap and falls
back to the default colormap and e.g. coolwarm, respectively.
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot() and imshow() relationship

2015-05-29 Thread Paul Hobson
imshow is for displaying arrays as images/rasters.

plot is for showing data/functions as points and lines.

See the gallery for imshow:
http://matplotlib.org/gallery.html#images_contours_and_fields

On Fri, May 29, 2015 at 4:12 AM, Amit Saha amitsaha...@gmail.com wrote:

 Hi all,

 I  am trying to understand if there is a way to compare how plot() and
 imshow() works for the case where I am not using imshow() to display
 an image.

 Via the plot() function, I am specifying the points that I want to
 plot and also optionally the color that i want the points to be in.
 For example, plot([1, 2, 3], [2, 3, 4], 'ro') will create a plot with
 those points colored red. Via the imshow() function, we specify the
 color (or intensity) of each point and a figure is created with the
 points colored accordingly. Sure, imshow() allows me to color each
 point differently.

 Is there a way to relate them?

 Also asked on StackOverflow:
 http://stackoverflow.com/questions/30527811/plot-and-imshow-relationship

 Thanks,
 Amit.


 --
 http://echorand.me


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Easy problem working with dev library

2015-05-16 Thread Paul Hobson
On Saturday, May 16, 2015 at 14:58, Neil Girdhar mistersh...@gmail.com, wrote:



Thanks, and if I want to revert my system to its old matplotlib?








​

​

​Assuming you cloned the repo from git, just checkout any revision you want.

​
If didn't clone from git, just reinstall matplotlib anyway you want. 










​-Paul. 







On Sat, May 16, 2015 at 5:52 PM, Paul Hobson pmhob...@gmail.com wrote:

After you've setup your development environment with all of the MPL 
dependencies, navigate to the MPL source directory and install it with:


$ python setup.py develop




or




$ pip install -e .




That'll create a link in site-packages (or whatever that directory is) to the 
source directory. After you make changes to the source code, you'll either need 
to use the imp module to reload MPL and the submodule you changed. I 
typically find it easier to just restart my python interpreter.

-Paul






On Sat, May 16, 2015 at 1:45 PM, Neil Girdhar mistersh...@gmail.com wrote:





How do I set it up so that I can import my local matplotlib dev copy?


I tried making a sym-link to matplotlib/lib/matplotlib, but it's giving me 
errors:





    import matplotlib.transforms as mtransforms

AttributeError: 'module' object has no attribute 'transforms'






Thanks,




Neil






--

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-devel mailing list
matplotlib-de...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] GridSpec.GridSpecFromSubplotSpec.update()

2015-04-03 Thread Paul Hobson
Hey Julian,

I'm not familiar enough from gridspec to help, but your emails were
received by the list.

If no one on the list has (time to write) a response, I would recommend
making your example a little more reproducible (e.g., what are a and b?)
and posting it on stackoverflow.


On Fri, Apr 3, 2015 at 1:11 PM, Julian Irwin julian.ir...@gmail.com wrote:

 Hey,

 Just checking if I sent this out properly. Can someone reply to let me
 know that this was seen, even if you don't have an answer?

 Thanks,
 Julian

 On Mon, Mar 30, 2015 at 10:10 PM, Julian Irwin julian.ir...@gmail.com
 wrote:

 Hey,

 I am making a plot using nested GridSpec objects. I would like to adjust
 the space between the the different GridSpecs.

 This works fine if I do something like:

 gs0 = gridspec.GridSpec(a, b)
 gs1 = gridspec.GridSpec(c, d)

 gs0.update(...)
 gs1.update(...)


 However, If I use GridSpecFromSubplotSpec to make the gridspec-like
 objects, this update() method is not provided:

 root_gs = gridspec.GridSpec(2, 1)

 gs0 = gridspec.GridSpecFromSubplotSpec(a, b, root_gs[0])
 gs1 = gridspec.GridSpecFromSubplotSpec(c, d, root_gs[1])

 gs0.update() #not a method!!

 I probed around in gs0.__dict__ and dir(gs0) but I couldn't find the
 right attributes...Can anyone suggest a solutions or a workaround?

 Thanks!
 Julian




 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs
 to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Interactive Applications using Matplotlib

2015-03-31 Thread Paul Hobson
Congrats, Ben. I know you've been working hard on this for a long time and I'm 
sure it'll be a great value to those looking to use matplotlib beyond just 
making a quick figure for a report. 

-Paul 



—
Sent from Mailbox

On Tue, Mar 31, 2015 at 11:02 AM, Benjamin Root ben.v.r...@gmail.com
wrote:

 The book I have been working on has now been published! It is about how to
 use most of the interactive features that comes with matplotlib in order to
 create your own GUI applications. The concepts are taught by building up a
 single application piece-by-piece, feature-by-feature. The final chapter
 then shows how to bring in tools from other GUIs, and also how to embed
 your figure into an existing GUI application (demonstrated for gtk,
 tkinter, wx and qt4).
 I really hope that the book is useful to the community, and that it is as
 enjoyable to read as it was for me to write!
 Cheers!
 Ben Root
 Order it on Amazon
 http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843/
 Or directly from Packt
 https://www.packtpub.com/application-development/interactive-applications-using-matplotlib--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] segmentation fault when saving images

2015-03-19 Thread Paul Hobson
What happens when you edit your program to avoid dividing by zero?

-p



—
Sent from Mailbox

On Thu, Mar 19, 2015 at 10:14 AM, Gabriele Brambilla
gb.gabrielebrambi...@gmail.com wrote:

 Hi guys,
 I don't understand why now, after I save an image when it is prompted out,
 the image is not saved and it closes automatically and on the terminal
 appears segmentation fault.
 this is what my terminal shows:
 [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py
 Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide
   lwb = 5/(np.log10(modB.max()/modB))
 Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide
   lwe = 5/(np.log10(modE.max()/modE))
 Segmentation fault
 Thanks
 Gabriele--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Corr plot in subplot

2015-03-17 Thread Paul Hobson
I'm confused is corrplot a matplotlib function? If it's not, there's not much 
we can do. You should probably just modify it to accept axes as parameters. 



—
Sent from Mailbox

On Tue, Mar 17, 2015 at 1:36 AM, Sudheer Joseph sudheer.jos...@yahoo.com
wrote:

 Hellow Paul,
  I thought I should show an example plot which shows the idea 
 of what I was asking about corrplot. Below link shows it.  
 http://matplotlib.org/examples/pylab_examples/multi_image.html
 
 On Tue, 17/3/15, Sudheer Joseph sudheer.jos...@yahoo.com wrote:
  Subject: Re: [Matplotlib-users] Corr plot in subplot
  To: Paul Hobson pmhob...@gmail.com, Adam Hughes 
 hughesada...@gmail.com
  Cc: Matplotlib Users matplotlib-users@lists.sourceforge.net
  Date: Tuesday, 17 March, 2015, 8:31 AM
  
  Hi Paul,
                  I could not succeed in
  plotting corrplot.Corrplot(df,ax=ax1).
  
  infact the plotting procedure is
  c=corrplot.Corrplot(df,ax=ax1)
  then issue command
  c.plot().
  So there are 2 steps involved, which may be the
  complication. I am not very well versed with Matplotlib.
  Kindly help.
  
  
  On Fri, 13/3/15, Adam Hughes hughesada...@gmail.com
  wrote:
  
   Subject: Re:
  [Matplotlib-users] Corr plot in subplot
   To:
  Paul Hobson pmhob...@gmail.com
   Cc: Sudheer Joseph sudheer.jos...@yahoo.com,
  Matplotlib Users matplotlib-users@lists.sourceforge.net
   Date: Friday, 13 March, 2015, 7:06 PM
   
   All the
  
  pandas plots that I've used take an axes keyword so
   try:
   
   c =
   corrplot.Corrplot(df, ax=ax1)
  
  
   or
   c =
  
  corrplot.Corrplot(df, axes=ax1)
   
   Do either of those
   work?
   On Fri,
   Mar 13, 2015 at 2:04
  PM, Paul Hobson pmhob...@gmail.com
   wrote:
   What's the
  function signature of
   corrplot.CorrPlot?
  Hopefully you can pass an Axes object to
   it
  argument.-p
   On Fri, Mar 13, 2015 at
   9:02 AM, Sudheer Joseph sudheer.jos...@yahoo.com
   wrote:
   Dear
  
  Matplotlib exprets,
   
   I am
  trying to place the corrplot in subplot environment.
   But not able to figure out how to do it
  properly. Can any
   one advice please?
   
   
   
   
   
   from
  biokit.viz import corrplot
   
   df = pd.DataFrame(dict(( (k,
  np.random.random(10)+ord(k)-65)
   for k in
  letters)))
   
   df =
  df.corr()
   
   c =
  corrplot.Corrplot(df)
   
   
   
   I wanted to make the
  corrplot in below 4 boxes which can
   come
  out as a single figure. The above data is a test data
   actually I wanted use seasonal data for this
  purpose.
   
   
   
   fig = plt.figure()
   
  
  fig.subplots_adjust(left=0.2, wspace=0.6)
  
  
   ax1 = fig.add_subplot(221)
   
   ax2 =
  fig.add_subplot(222)
   
   ax3
  = fig.add_subplot(223)
   
  
  ax4 = fig.add_subplot(224)
   
   
   
   
   
  
  ***
   
   Sudheer Joseph
   
   Indian National Centre for
  Ocean Information Services
   
   Ministry of Earth Sciences, Govt. of India
   
   POST BOX NO: 21, IDA
  Jeedeemetla P.O.
   
   Via
  Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
   
  
  Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
   
  
  Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
   
   E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com
   
   Web- http://oppamthadathil.tripod.com
   
  
  ***
   
   
   
  
  
 --
   
   Dive into the World of
  Parallel Programming The Go Parallel
  
  Website, sponsored
   
   by
  Intel and developed in partnership with Slashdot Media,
   is your hub for all
   
   things parallel software development, from
  weekly thought
   leadership blogs to
   
   news, videos, case studies,
  tutorials and more. Take a look
   and join
  the
   
   conversation now. http://goparallel.sourceforge.net/
   
  
  ___
   
   Matplotlib-users mailing
  list
   
   Matplotlib-users@lists.sourceforge.net
   
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   
   
   
   
  
  
 --
   
   Dive into the World of
  Parallel Programming The Go Parallel
  
  Website, sponsored
   
   by
  Intel and developed in partnership with Slashdot Media,
   is your hub for all
   
   things parallel software development, from
  weekly thought
   leadership blogs to
   
   news, videos, case studies,
  tutorials and more. Take a look
   and join
  the
   
   conversation now. http://goparallel.sourceforge.net/
  
  ___
   
   Matplotlib-users mailing
  list
   
   Matplotlib-users@lists.sourceforge.net
   
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Re: [Matplotlib-users] Problems with pyplot and cm in Matplotlib ver. 1.4.3

2015-02-21 Thread Paul Hobson
Hey Starfighter, 




I want to help, but I also don't like unzipping files from strangers. Can you 
make a simple script that generates some fake with numoy and the handful of 
matplotib commands you need to make the figure. 

-p



—
Sent from Mailbox

On Sat, Feb 21, 2015 at 7:34 PM, Starfighter sdup...@speakeasy.net
wrote:

 Per request my question is being resubmitted here.
 I'm attempting to generate contour and a color map in Matplotlib ver. 1.4.3
 on a MacBook Pro under Mac OS X ver. 10.10.2 in Python 2.7.3 with the
 Anaconda environment. 
 A zip file has been attached to this note. Two sub-directories,
 mathplotlib_1.4.3 and mathplotlib_1.1.1rc are included.
 mathplotlib_1.4.3 contains the python script that generates the contour and
 color map plots, jpeg files showing the resultant plots and the input data. 
 mathplotlib_1.1.1rc contains the screen snaps (jpeg files) showing the
 correct contour and color map plots generated by the same python script and
 input data under Linux2 using Python 2.7.3 and Matplotlib 1.1.1rc.
 The questions I have include:
1. What are the differences between Matplotlib vers. 1.1.1rc and 1.4.3?
2. What is going on where?
3. How can I fix this problem?
 Please advise.
 mathplotlib_issues.zip
 http://matplotlib.1069221.n5.nabble.com/file/n45004/mathplotlib_issues.zip  
 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002p45004.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=190641631iu=/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=190641631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to add data points to a contour map.

2015-02-12 Thread Paul Hobson
Definitely. Assuming you don't want to do this in an interactive manner
(i.e. pointing and clicking with your mouse:

fig, ax  = plt.subplots()
ax.contour(...)
ax.plot(x_dots, y_dots, 'ro', label='Dots')
-p

On Thu, Feb 12, 2015 at 8:07 AM, Dr Sydney Shall sydney.sh...@meshnet.fr
wrote:

 I am a beginner and I use Python 2.7 on an iMac OSX 10.9.5. Python is
 the Enthought installation.
 I am doing simulation experiments. I have constructed a 2D contour map
 with my results and I am happy with the result.
 I am wondering if it is possible to add the data points, say as red
 dots, on this contour map.
 I have not been able to find an equivalent example in gallery and I am
 too much a novice to know what to do.
 Any help would be much appreciated.

 --
 Sydney



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] synchronize magnification of subplots?

2015-02-03 Thread Paul Hobson
I only have the notebook to mes around in, but the following works for me:

%matplotlib nbagg
import matplotlib.pyplot as plt

fig, ax = plt.subplots(nrows=2, sharex=True, sharey=True)

On Tue Feb 03 2015 at 4:07:26 PM Neal Becker ndbeck...@gmail.com wrote:

 I have 2 subplots, 2 rows 1 col.  They have the same x-axis.

 I'd like to be able to zoom in on both plots together.  Using qt4agg,
 there is a
 zoom icon, but it seems to operated on each subplot separately.

 --
 -- Those who don't understand recursion are doomed to repeat it


 
 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] using it in a Qt5-Widget

2015-01-28 Thread Paul Hobson
At the top of www.matplotlib.org, there is an examples link.

Scroll down a bit, there's a section titled user interface examples
http://matplotlib.org/examples/user_interfaces/index.html

The QT4 example works on my machine currently, so it's reasonably up to
date.
-p

On Wed, Jan 28, 2015 at 11:38 AM, moon...@posteo.org wrote:

 On 2015-01-28 16:25 Thomas Caswell tcasw...@gmail.com wrote:
  It should be exactly the same as for Qt4, just importing from the Qt5
  version

 Sorry, but my question was to unspecific.

 I don't know how it worked with Qt4.

 I need to know I can draw a plot into a QWidget or something else. I
 couldn't find an example or documentation about it.


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contour3D in matplotlib

2015-01-20 Thread Paul Hobson
The gallery had a comprehensive set of available three dimensional plots, I
think.

http://matplotlib.org/gallery.html#mplot3d
On Tue, Jan 20, 2015 at 01:19 Nils Wagner nils...@googlemail.com wrote:

 Hi all,

 I found


 http://stackoverflow.com/questions/9419451/3d-contour-plot-from-data-using-mayavi-python

 Is there something similar in matplotlib ?


 Nils


 
 --
 New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
 GigeNET is offering a free month of service with a new server in Ashburn.
 Choose from 2 high performing configs, both with 100TB of bandwidth.
 Higher redundancy.Lower latency.Increased capacity.Completely compliant.
 http://p.sf.net/sfu/gigenet___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Matplotlib style gallery

2015-01-05 Thread Paul Hobson
Tony! This is very cool. Bravo.

On Mon, Jan 5, 2015 at 8:42 PM, Tony Yu tsy...@gmail.com wrote:

 I've been playing around with learning Javascript lately. As part of the
 process, I created a Flask app to build a gallery for matplotlib style
 sheets:

 https://github.com/tonysyu/matplotlib-style-gallery

 If you run that locally, you can actually input styles, either with a URL
 to a *.mplstyle file or with matplotlibrc commands. Here's a static version
 without the custom inputs:

 http://tonysyu.github.io/raw_content/matplotlib-style-gallery/gallery.html

 Ideally, I'd get this into a form that could be submitted as a PR for the
 matplotlib website, but I'll need a bit more spare time to learn some more
 web development (sessions, client storage, etc).

 Cheers!
 -Tony


 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] two axes

2014-12-02 Thread Paul Hobson
You didn't label any of the series that you put on the graph, so the legend
has no idea what to call anything thing.

Like the warning (not error) says, use the label parameter on your calls to
plot, e.g., ax1.plot(..., label='Concentration') or whatever.

Note though, that you're mixing up interfaces in your script as written.
MPL's many interfaces are kind of mess, but you seem reasonably familiar
with the OO interface, so stick to that. What I mean is once you start
messing with ax1, and ax2 directly, don't revert back to call to plt. As
written, you'll only get a legend on ax2, but you haven't plotted anything
there.

If you want a legend on ax1, use ax1.legend.
-p

On Tue, Dec 2, 2014 at 1:59 AM, Tommy Carstensen tommy.carsten...@gmail.com
 wrote:

 In gnuplot it is quite easy to create two axes, but I can't figure out
 how to do it in matplotlib. I'm trying this:

 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt

 for key1 in keys1:
 ax1.plot(x, y, style, label=label, color=color, linewidth=3)
 ax1.set_xlabel(xlabel)
 ax1.set_ylabel(ylabel1)
 ax2.set_ylabel(ylabel2)
 plt.legend(loc='lower right', shadow=True)
 plt.suptitle(title, fontsize=14, fontweight='bold')
 axes = plt.gca()
 axes.set_ylim([0,1])
 plt.grid(b=True, which='major', color='k', linestyle='--')
 plt.savefig('{}.png'.format(key1), dpi=600)
 plt.close()
 plt.clf()

 But I get this error:
 lib/python3.3/site-packages/matplotlib/axes.py:4749: UserWarning: No
 labeled objects found. Use label='...' kwarg on individual plots.
   warnings.warn(No labeled objects found. 

 What am I doing wrong? Thanks.


 --
 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=157005751iu=/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=157005751iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] multiple plots on single axis

2014-11-27 Thread Paul Hobson
Check out the third example in the gallery:
Gallery Link:
http://matplotlib.org/gallery.html

Direct Link:
http://matplotlib.org/examples/lines_bars_and_markers/fill_demo_features.html

On Thu, Nov 27, 2014 at 6:55 AM, Bala subramanian bala.biophys...@gmail.com
 wrote:

 Friends,

 I want to make multiple graphs on a single axes. As an example, i am
 pasting below an article where it has been shown.

 http://www.ncbi.nlm.nih.gov/pubmed/23403925

 My plot of interest is *Figure7B*, where multiple distribution are
 depicted in single plot. I want to make a similar one. Kindly give me some
 insights on how i can make it with mpl, if anyone have achieved making it
 with mpl.

 Thanks in advance,
 Bala


 --
 C. Balasubramanian


 --
 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=157005751iu=/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=157005751iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can not display 3D plot !

2014-11-13 Thread Paul Hobson
Does a fresh conda environment help?

On Wed, Nov 12, 2014 at 5:38 PM, Geoffrey Mégardon 
geoffrey.megar...@gmail.com wrote:

 Yes, I may forget to tell, but this code is 100% working, it work on other
 installations I have. So the problem is not in the code.

 It is just that on my current laptop, I don't know why, this code, which
 tries to display a 3d plot, leads to a crash.
 Note that 2D plots work fine on their side.

 I have an other PC on windows 8.1, and everything work fine on it, I
 installed the same Anaconda 64-bit version.

 So it is something to do with my environment, but it is not linked to the
 OS itself, and it is linked with 3D displaying only I would say.

 Any idea? :)


 On 12 November 2014 18:44, Jerzy Karczmarczuk 
 jerzy.karczmarc...@unicaen.fr wrote:


 Le 13/11/2014 00:13, Geoffrey Mégardon a écrit :

 ...

 But to create the 3D axes, to draw in it, and then to show the
 figure, that crashes:
  from mpl_toolkits.mplot3d import axes3d
 import matplotlib
 matplotlib.use(agg)
 import matplotlib.pyplot as plt

 fig = plt.figure()
 ax = fig.add_subplot(111, projection='3d')
 X, Y, Z = axes3d.get_test_data(0.05)
 cset = ax.contour(X, Y, Z)
 ax.clabel(cset, fontsize=9, inline=1)

 plt.show()


 Basically on iPython QT console I would get an error like:
 Kernel died, restarting

Perhaps it is your environment, not Matplotlib.
 A copy-paste of this program run without problems on my system.
 Anaconda 64 bits, IPython console (within Spyder).
 But *Windows 7*, not 8.

 Jerzy Karczmarczuk


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.

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




 --
 --
 MEGARDON Geoffrey


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.

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


--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib save image as postscript, when xlabel is saved as text and not path

2014-11-03 Thread Paul Hobson
What happens when you save as a postscript file with
matplotlib.rcParams[text.usetex] = False?
-paul

On Mon, Nov 3, 2014 at 7:11 AM, Oren oren...@gmail.com wrote:

 Anyone know how to solve this thing?

 Thanks.

 On 2 November 2014 03:40, oren oren...@gmail.com wrote:

 How can I save a matplotlib figure with text as a postscript image and
 that
 the text will be saved as text. Currently when I save the image as
 postscript all the text in the image ( xlabel, ylabel etc.. ) is saved as
 path and not as text.. Is it possible to save it as text?

 If I use the following code ( use latex)

 matplotlib.rcParams[text.usetex] = True
 and save the image as postscript the text is saved as text.. But I do not
 want to use latex.. Is it possible without latex?


 Thanks


 Question also on stackoverflow

 http://stackoverflow.com/questions/26649266/matplotlib-save-image-as-postscript-when-xlabel-is-saved-as-text-and-not-path



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/matplotlib-save-image-as-postscript-when-xlabel-is-saved-as-text-and-not-path-tp44261.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib save image as postscript, when xlabel is saved as text and not path

2014-11-03 Thread Paul Hobson
Can just go straight to PDF? What happens then? It might also be
informative to explain why using LaTeX is undesirable in your situation.
-p

On Mon, Nov 3, 2014 at 11:52 AM, Oren oren...@gmail.com wrote:

 Thanks for the respond Paul, But It still the same...

 This is how it looks like when I use
 matplotlib.rcParams[text.usetex] = False ( or noting at all )

 [image: Inline images 1]



 and this is when I use
 matplotlib.rcParams[text.usetex] = True

 [image: Inline images 2]





 As you can see, One is text and the other is path of points..


 Thank You,
 Oren.




 On 3 November 2014 21:40, Paul Hobson pmhob...@gmail.com wrote:

 What happens when you save as a postscript file with
 matplotlib.rcParams[text.usetex] = False?
 -paul

 On Mon, Nov 3, 2014 at 7:11 AM, Oren oren...@gmail.com wrote:

 Anyone know how to solve this thing?

 Thanks.

 On 2 November 2014 03:40, oren oren...@gmail.com wrote:

 How can I save a matplotlib figure with text as a postscript image and
 that
 the text will be saved as text. Currently when I save the image as
 postscript all the text in the image ( xlabel, ylabel etc.. ) is saved
 as
 path and not as text.. Is it possible to save it as text?

 If I use the following code ( use latex)

 matplotlib.rcParams[text.usetex] = True
 and save the image as postscript the text is saved as text.. But I do
 not
 want to use latex.. Is it possible without latex?


 Thanks


 Question also on stackoverflow

 http://stackoverflow.com/questions/26649266/matplotlib-save-image-as-postscript-when-xlabel-is-saved-as-text-and-not-path



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/matplotlib-save-image-as-postscript-when-xlabel-is-saved-as-text-and-not-path-tp44261.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 overlaid plots with grid??

2014-10-22 Thread Paul Hobson
I seem to recall that the MaxNLocator and some carefully chosen axes limits
suffices for me in the past.

On Tue, Oct 21, 2014 at 11:44 AM, Adam Hughes hughesada...@gmail.com
wrote:

 I wrote a program that draws grids manually on mpl plots a while back.  If
 you can't find a solution can you write back here and I'll try to get that
 dusted off?
 On Oct 21, 2014 2:39 PM, Benjamin Root ben.r...@ou.edu wrote:

 Well, the first part is easy... it is called twinx(). If you look up axis
 twinning in the documentation, you will find a lot of examples of this.

 As for the grids part... that would be tricky. I would first just see if
 matplotlib just does the right thing. Doubtful, but who knows? Then I
 would likely go the route of lining up the major ticks on both axes so that
 the grid lines for one axes match up with the ticks for the other.

 Let us know what you find out. Maybe it might be a useful feature to add
 for twinning.

 Cheers!
 Ben Root


 On Tue, Oct 21, 2014 at 2:29 PM, Neal Becker ndbeck...@gmail.com wrote:

 I need to overlay 2 different plots.  They will share an x-axis, but
 will have 2
 different y axis with 2 different sets of units.  I want one y-axis on
 left and
 one on right.

 But to make it harder, I want a grid.  That means, there are either 2
 different
 grids, which is ugly, or one plot has to be scaled vertically so that
 the same y
 grid can be shared between them.

 Anyone know how to do this?

 --
 -- Those who don't understand recursion are doomed to repeat it



 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] python3 and basemap bluemarble()

2014-10-17 Thread Paul Hobson
Tom,

I believe the pillow package is the actively maintained fork of PIL.
Could be wrong on that though.
-p

On Fri, Oct 17, 2014 at 4:27 AM, Tommy Carstensen 
tommy.carsten...@gmail.com wrote:

 To matplotlib-users,

 basemap bluemarble() requires PIL, which is not available for Python3.
 What is the usual workaround, when using Python and wanting to do
 bluemarble()?

 Thanks,
 Tommy


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.
 http://p.sf.net/sfu/Zoho
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using unregistered scales

2014-10-07 Thread Paul Hobson
Here's that second link for the scale:
https://gist.github.com/phobson/3cc3550ce1efcc299142

On Mon, Oct 6, 2014 at 1:27 PM, Paul Hobson pmhob...@gmail.com wrote:

 MPL Users,

 Using [1] as a template, I built a ProbabilityScale[2] which I hope one
 day will be in the statsmodels library. It still needs some work, but it's
 mostly there.

 I have, what I hope is a basic question:
 Do I have to register the scale in order to use it, or is there an axes
 method to feed it the ProbScale class directly?

 I notice that there is an axes.xaxis._set_scale method -- but there
 appears to be no public API way of using an unregistered scale.

 If it is the case that there's no sanctioned way of applying an
 unregistered scale to an Axes object, when/where in a module is best to
 register it (e.g., on import, locally within a the function/method that
 needs it)?

 Cheers,
 -paul

 [1]
 http://matplotlib.org/examples/api/custom_scale_example.html?highlight=codex%20set_major_locator

--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Using unregistered scales

2014-10-06 Thread Paul Hobson
MPL Users,

Using [1] as a template, I built a ProbabilityScale[2] which I hope one day
will be in the statsmodels library. It still needs some work, but it's
mostly there.

I have, what I hope is a basic question:
Do I have to register the scale in order to use it, or is there an axes
method to feed it the ProbScale class directly?

I notice that there is an axes.xaxis._set_scale method -- but there appears
to be no public API way of using an unregistered scale.

If it is the case that there's no sanctioned way of applying an
unregistered scale to an Axes object, when/where in a module is best to
register it (e.g., on import, locally within a the function/method that
needs it)?

Cheers,
-paul

[1]
http://matplotlib.org/examples/api/custom_scale_example.html?highlight=codex%20set_major_locator
--
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xkcd

2014-10-03 Thread Paul Hobson
That's what the `with` statement allows you do.

Say you have a function that does some plotting and returns a figure --
call it my_plot_func.

You can do:

fig1 = my_plot_func()
fig1.savefig('normal1.png')

with plt.xkcd():
fig2 = mu_plot_func()
fig2.savefig('xkcd.png')

fig2 = my_plot_func()
fig2.savefig('normal2.png')

And the xkcd image will be squiggly but the normal images won't.
-p

On Fri, Oct 3, 2014 at 12:40 PM, Christophe Bal projet...@gmail.com wrote:

 Hello.

 I've only seen one way to use the xkcd feature. This uses a with statement.

 Is there another way to use the xkcd feature so as to easily switch
 between exact plot and trembling one ?

 Christophe BAL


 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

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


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] seg fault installing

2014-10-01 Thread Paul Hobson
You mean matplotlib 1.3.1 and numpy 1.8.1, right?--
Paul Hobson
Sorry if this is unintelligible. I'm on my phone.

On Wed, Oct 1, 2014 at 9:36 AM, Steve McAfee smcafee.soc...@gmail.com
wrote:

 This is really old. It's a readynas from netgear running etch with a bunch
 of backports. It seems that something in numpy or matplotlib changed in the
 last 6 months that caused this. There is a lengthy procedure to getting
 virtualbox running on this config. The instructions for doing this are on
 the readynas forum. I ran through them and they worked 6 months ago, but I
 reinstalled the system for an unrelated reason and when I went back to the
 instructions they wouldn't work at the step to install matplotlib. After I
 realized it was because these versions were updated I got it to work by
 selecting numpy 1.3.1 and matplotlib 1.8.1 which were available (by date)
 the last time it worked.
 Gdb was strange, the calling function showed the meta variable as a
 pointer, but in the failing function it was 0x10. 0x10 happens to be the
 first value in the meta data structure so it seems like a function
 definition or compiler issue. Wierd, but I'm ok running the old version on
 this box that doesn't change very often.
 steve
 On Wed, Oct 1, 2014 at 11:48 AM, Paul Hobson pmhob...@gmail.com wrote:
 Which OS are you on?

 Before Anaconda, I would use sudo apt-get build-dep python-matplotlib to
 get all of the dependencies and then sudo python setup.py install from
 the matplotlib directory and it would work fine.

 Now that Anaconda is around, I just conda create --name=mpldev matplotlib
 python=3.3 and then source activate mpldev followed by pip install -e
 . from the matplotlib source directory.

 On Wed, Oct 1, 2014 at 6:40 AM, Steve smcafee.soc...@gmail.com wrote:

 I had installed these a couple of months ago successfully so I tried
 versions
 from that timeframe (numby 1.3.1 and matplotlib 1.8.1) and that worked
 fine.

 FWIW with the latest versions the crash was at line 1965 of datetime.c.
 The
 meta variable was not a pointer. It was actually the value of the first
 member of the meta variable passed in by the calling function. I'm using
 gcc
 4.1.1.

 steve



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/seg-fault-installing-tp44049p44050.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

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


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] zoom a plot

2014-09-15 Thread Paul Hobson
I don't think you'll get acceptable performance out of that workflow.

I recommend looking into the webagg backend:
http://matplotlib.org/users/whats_new.html#webagg-backend

On Mon, Sep 15, 2014 at 8:38 AM, Xiaobo Yang xiaobo.y...@gmail.com wrote:

 Hi, I use matplotlib to create a png file, then display it in a web
 browser. All works fine. Now I want to zoom the plot. What I can think of
 is:

 1) Get coordinates (x1, y1), (x2, y2) of the image when user makes an area
 selection on the image;

 2) Convert (x1, y1), (x2, y2) to the real values matplotlib was plotting;

 3) Request matplotlib to create a new png file using the updated area
 values.

 Could anybody please let me know how to accomplish step 2?

 Many thanks,
 Tom


 --
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce
 Perforce version control. Predictably reliable.

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


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] zoom a plot

2014-09-15 Thread Paul Hobson
Yes. They are on the same webpage to which I linked earlier.

http://matplotlib.org/search.html?q=codex+webaggcheck_keywords=yesarea=default

On Mon, Sep 15, 2014 at 9:28 AM, Tom Young xiaobo.y...@gmail.com wrote:

 Thank you for your quick answer. I understand the performance issue you
 mentioned. For now it is only a proof of concept.

 I just figured out how to do it in theory by using
 figure.subplot.left|right|bottom|top plus a few other settings.

 I'll certainly look at the webagg backend. Are there any examples
 available?



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/zoom-a-plot-tp43952p43954.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce
 Perforce version control. Predictably reliable.

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

--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] (no subject)

2014-09-05 Thread Paul Hobson
How do you do this in a normal LaTeX document?


On Fri, Sep 5, 2014 at 12:53 PM, Arnaldo Russo arnaldoru...@gmail.com
wrote:

 Hi,

 I'm trying to figure out how I could use greek letters on axis labels,
 without italic.
 I have read a lot about alternatives, but I do need to use LaTeX to insert
 a table inside the plot area.

 Using mathtex it responds with normal font on greek letters.

 What I`m doing wrong?

 The following code plots my table, but greek letters are not in Arial.

 import numpy as npimport matplotlib.pyplot as plt

 t2 = np.arange(100)
 fig  = plt.figure(figsize=(8,4))
 ax = fig.add_subplot(111)

 plt.rcParams.update({'font.family' : 'sans-serif',
 'font.sans-serif' : 'Arial',
 'font.style' : 'normal',
 'xtick.labelsize' : 12,
 'ytick.labelsize' : 12,
 'mathtext.fontset' : 'stixsans',
 'mathtext.default': 'regular',
 'mathtext.tt' : 'Arial',
  })
 plt.subplots_adjust(left=0.12, right=0.95, top=0.95, bottom=0.1)


 ax.set_xlim(0,100)
 xvals = [0, 16.6, 33.33, 50, 66.66, 83.33, 100]
 ax.set_xticks(xvals)
 ax.set_xticklabels(['tick 0', 'tick 1', 'tick 2','tick 3', 'tick 4', 'tick 
 5', 'tick 6'])
 ax.set_ylabel(r'$\mu$text $\eta$text $\cdot$ m$^{-2}$ s$^{-1}$')
 ax.set_yticklabels(['0', '200', '400', '600', '800', '1000', '1200', '1400'])
 ax.plot(t2, color='black')
 ax.fill_between(np.arange(0, len(t2)),t2,0, color='black', alpha=0.8)

 from matplotlib import rc
 rc('font',**{'family':'sans-serif','sans-serif':['Arial']})
 rc('text', usetex=True)
 table = r'''\begin{tabular}{lccc}\hlinetick 0 tick 1  tick 2  tick 3 
  tick 4  tick 5  tick 6 \\\hline Vals  32.00  3.28  5.80  5  8  45  
 7.3 \\\hline \end{tabular}'''
 plt.text(20,80,table,size=10)

 plt.show()


 And an example using Mathtex, using regular fonts work out of the box, but
 my table of course is included as plain text. I have to close my IPython
 session and start it again to correct usage of plot parameters.

 import numpy as npimport matplotlib.pyplot as plt

 t2 = np.arange(100)
 fig  = plt.figure(figsize=(8,4))
 ax = fig.add_subplot(111)

 plt.rcParams.update({'xtick.labelsize' : 12,
 'ytick.labelsize' : 12,
 'mathtext.fontset' : 'stixsans',
 'mathtext.default': 'regular',
 'mathtext.tt' : 'Arial',
 })
 plt.subplots_adjust(left=0.12, right=0.95, top=0.95, bottom=0.1)


 ax.set_xlim(0,100)
 xvals = [0, 16.6, 33.33, 50, 66.66, 83.33, 100]
 ax.set_xticks(xvals)
 ax.set_xticklabels(['tick 0', 'tick 1', 'tick 2','tick 3', 'tick 4', 'tick 
 5', 'tick 6'])
 ax.set_ylabel(r'$\mu$text $\eta$text $\cdot$ m$^{-2}$ s$^{-1}$')
 ax.set_yticklabels(['0', '200', '400', '600', '800', '1000', '1200', '1400'])
 ax.plot(t2, color='black')
 ax.fill_between(np.arange(0, len(t2)),t2,0, color='black', alpha=0.8)
 #from matplotlib import 
 rc#rc('font',**{'family':'sans-serif','sans-serif':['Arial']})#rc('text', 
 usetex=True)
 table = r'''\begin{tabular}{lccc}\hlinetick 0 tick 1  tick 2  tick 3 
  tick 4  tick 5  tick 6 \\\hline Vals  32.00  3.28  5.80  5  8  45  
 7.3 \\\hline \end{tabular}'''
 plt.text(20,80,table,size=10)

 plt.show()


 Regards,
 Arnaldo.

 ---
 *Arnaldo D'Amaral Pereira Granja Russo*
 Lab. de Estudos dos Oceanos e Clima
 Instituto de Oceanografia - FURG




 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pick a particular data from array

2014-06-17 Thread Paul Hobson
Based on the example you posted, you need like:

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.contour(data)
ax.axhline(magic_value)


On Mon, Jun 16, 2014 at 1:30 AM, dydy2014 dyahr...@gmail.com wrote:

 Hello all,

 I have contour plot like this and I have problem to pick a particular data
 along red line and save it.
 How do I make it with python program?

 http://matplotlib.1069221.n5.nabble.com/file/n43532/190311.png

 Thank you in advance.

 Dydy



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Pick-a-particular-data-from-array-tp43532.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
 Find What Matters Most in Your Big Data with HPCC Systems
 Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 Leverages Graph Analysis for Fast Processing  Easy Data Exploration
 http://p.sf.net/sfu/hpccsystems
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot crases because of XDG_CONFIG_HOME variable

2014-05-07 Thread Paul Hobson
How did you install matplotlib? I've had success using anaconda on cheap
$7/month web servers before
http://continuum.io/downloads


On Wed, May 7, 2014 at 7:20 AM, Paul Tremblay paulhtremb...@gmail.comwrote:

 I am using matplotllib as part of web server. matplotlib causes my server
 to crash with this error:

 File
 /apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py, line
 597, in _get_configdir
 return _get_config_or_cache_dir(_get_xdg_config_dir())
   File
 /apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py, line
 534, in _get_xdg_config_dir
 return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(),
 '.config'))
   File
 /apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py,
 line 77, in join
 elif path == '' or path.endswith('/'):
 type 'exceptions.AttributeError': 'NoneType' object has no attribute
 'endswith'

 I have no home directory on my server (and probably don't have the
 permissions to create one). What is the correct way to fix this problem?

 Thanks!

 Paul



 --
 Is your legacy SCM system holding you back? Join Perforce May 7 to find
 out:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Which api to learn?

2014-04-30 Thread Paul Hobson
The only pyplot function I let myself use is plt.subplots() to quickly
create the Figure and Axes objects. From that point on, I operate on those
objects directly. Frankly, it reads almost exactly like pyplot code, but it
is a *lot* more clear what's going on.


On Wed, Apr 30, 2014 at 4:49 AM, Neal Becker ndbeck...@gmail.com wrote:

 I've never used matlab (and hope never to have to).  But I've been using
 pyplot
 api for mpl for quite a while.

 Is there any good reason to move to the native mpl api and drop pyplot?
  I ask
 because as I understand, pyplot is intended as a matlab workalike, and
 since I
 never learned matlab I have no need for that crutch.  OTOH, I'm quite used
 to
 the pyplot api at this point.



 --
 Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
 Instantly run your Selenium tests across 300+ browser/OS combos.  Get
 unparalleled scalability from the best Selenium testing platform available.
 Simple to use. Nothing to install. Get started now for free.
 http://p.sf.net/sfu/SauceLabs
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation problem

2014-04-29 Thread Paul Hobson
As the error says, you need the dateutil package. It available here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil


On Mon, Apr 28, 2014 at 11:10 PM, Stam Golesh stamgol...@gmail.com wrote:

 hi all

 downloaded and installed
 matplotlib-1.3.1.win32-py3.2.exe

 this is what i get
  import matplotlib
 Traceback (most recent call last):
   File pyshell#6, line 1, in module
 import matplotlib
   File E:\programs\python
 3.2.3\lib\site-packages\matplotlib\__init__.py, line 112, in module
 raise ImportError(matplotlib requires dateutil)
 ImportError: matplotlib requires dateutil

 now what?


 --
 Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
 Instantly run your Selenium tests across 300+ browser/OS combos.  Get
 unparalleled scalability from the best Selenium testing platform available.
 Simple to use. Nothing to install. Get started now for free.
 http://p.sf.net/sfu/SauceLabs
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] datestr2num for day/month/year

2014-04-25 Thread Paul Hobson
You might have more luck reading in that data (dates with mixed format)
with pandas than numpy.



On Fri, Apr 25, 2014 at 2:37 AM, Mark Bakker mark...@gmail.com wrote:

 Thanks, Andreas, but it doesn't quite work.

 This works for me (I manually changed all dates to 'day-month-year' for
 testing):

 a = loadtxt('test.csv',converters={2:strpdate2num('%d-%m-%Y')})

 But when I define the same function in a separate function, as you
 suggested:

 def conv_date(s):
  return strpdate2num('%d-%m-%Y')

 and do

 a = loadtxt('test.csv',converters={2:conv_date})

 I get the non-descript error:

 loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols,
 unpack, ndmin)
 847 fh.close()
 848
 -- 849 X = np.array(X, dtype)
 850 # Multicolumn data are returned with shape (1, N, M), i.e.
 851 # (1, 1, M) for a single row - remove the singleton dimension
 there

 SystemError: error return without exception set

 Any suggestions?

 Thanks, Mark




 On Fri, Apr 25, 2014 at 11:17 AM, Andreas Hilboll li...@hilboll.dewrote:

 On 25.04.2014 11:02, Mark Bakker wrote:
  OK, I figured out I can use:
  converters={0:strpdate2num('%d-%m-%y')}
 
  What now if part of my dates are given as 'day-month-year' and part as
  'day/month/year' in the same file (I know, who does that, an I could do
  a replace first and then read it in). Can I specify both formats for the
  converter? I guess not

 Try this:

def _conv_date(s):
try:
return strpdate2num('%d-%m-%y')
except Exception:   # figure out which exception class to use
return strpdate2num('%d/%m/%y')

converters={0:_conv_date}

 Cheers, Andreas.


 
  Thanks,
 
  Mark
 
 
 
  On Fri, Apr 25, 2014 at 10:46 AM, Mark Bakker mark...@gmail.com
  mailto:mark...@gmail.com wrote:
 
  Hello List,
 
  datestr2num works great when dates are stored as month/day/year (as
  American like).
 
  Europeans store them as day/month/year.
 
  Any quick function to convert a day/month/year string do a date? Is
  there an eu version: datestr2numeu?
 
  Thanks,
 
  Mark
 
 
 
 
 
 --
  Start Your Social Network Today - Download eXo Platform
  Build your Enterprise Intranet with eXo Platform Software
  Java Based Open Source Intranet - Social, Extensible, Cloud Ready
  Get Started Now And Turn Your Intranet Into A Collaboration Platform
  http://p.sf.net/sfu/ExoPlatform
 
 
 
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 


 --
 -- Andreas.




 --
 Start Your Social Network Today - Download eXo Platform
 Build your Enterprise Intranet with eXo Platform Software
 Java Based Open Source Intranet - Social, Extensible, Cloud Ready
 Get Started Now And Turn Your Intranet Into A Collaboration Platform
 http://p.sf.net/sfu/ExoPlatform
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-20 Thread Paul Hobson
What parameters are you passing to `savefig`?


On Sat, Apr 19, 2014 at 1:13 PM, Chao YUE chaoyue...@gmail.com wrote:

 Dear all,

 Did anyone try to make plots using matplotlib, and then put the figure in
 the powerpoint for presentation? Currently I am using the ipython notebook
 --pylab mode to make the plots, and then save them to *jpg format. But when
 I put it into the powerpoint, it does not look nice as I see on the screen
 (a little bit blurred). You can really not notice it if you don't examine
 carefully. But I really want to make high quality slides. So does anyone
 have the same problem? could it be related with the figure format or
 backend (GTKAgg) currently I am uisng? thanks a lot in advance.

 Cheers,

 Chao

 --
 please visit:
 http://www.globalcarbonatlas.org/

 ***
 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

 


 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Variable size markers legend formatting

2014-04-11 Thread Paul Hobson
Hey Adam,

I wouldn't make a circle, instead use a Line2D artist (accessible from
pyplot) with they same (base) symbology as your scatter plot. It has pretty
much the same call signature as ax.plot

-paul


On Fri, Apr 11, 2014 at 9:35 AM, Sterling Smith smit...@fusion.gat.comwrote:

 Adam,

 I agree that the Circle ended up with a rectangle in the legend, which I
 wouldn't think of as the expected response.  Would the following work for
 your purposes?

 figure()
 p,=plot(0,0,marker='o',ls='',color='red')
 legend([p], [Red Rectangle],numpoints=1)
 p.remove()
 draw()

 -Sterling

 On Apr 11, 2014, at 8:14AM, Adam Hughes wrote:

  Hi Paul,
 
  I tried out the legend proxy artist, and it works for rectangles in the
 legend, but I can't seem to get a Circle to appear in the legend, which I
 presume should be:
 
  p = Circle((0, 0), fc=r)
  legend([p], [Red Rectangle])
 
 
  On Wed, Apr 9, 2014 at 2:20 PM, Adam Hughes hughesada...@gmail.com
 wrote:
  Thanks Paul, I will try it out.
 
 
  On Wed, Apr 9, 2014 at 12:21 PM, Paul Hobson pmhob...@gmail.com wrote:
 
 
 
  On Wed, Apr 9, 2014 at 9:00 AM, Adam Hughes hughesada...@gmail.com
 wrote:
  Thanks.  That's probably the way I'll go.  At first, I thought creating
 separate legend markers and removing them from the plot seemed hacky, but I
 guess there's no way that matplotlib could know which legend size I want.
  I wonder if there'd be any interest in a PR to add a keyword to legend to
 handle this situation?
 
  Why not just work the other way around with proxy artists. IOW, make the
 artists but never add them to the plot.
 
 
 http://matplotlib.org/users/legend_guide.html?highlight=proxy%20artists#using-proxy-artist
  (works with Line2D artists)
 
  -p
 
 
 
  On Wed, Apr 9, 2014 at 1:44 AM, Sterling Smith smit...@fusion.gat.com
 wrote:
  Adam,
 
  I haven't investigated, but does the discussion of the legend marker at
 [1] help?
 
  -Sterling
 
  [1]
 https://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg25200.html
 
  On Apr 8, 2014, at 3:44PM, Adam Hughes wrote:
 
   Hello,
  
   I've been searching but can't seem to find this topic addressed
 (perhaps wrong search terms)
  
   Simply put, I have a scatter plot with variable size markers, and I'd
 like to have the markers all be a single size in the legend.  Is there a
 standard way to do this?
  
   Thanks.
  
 --
   Put Bad Developers to Shame
   Dominate Development with Jenkins Continuous Integration
   Continuously Automate Build, Test  Deployment
   Start a new project now. Try Jenkins in the cloud.
  
 http://p.sf.net/sfu/13600_Cloudbees___
   Matplotlib-users mailing list
   Matplotlib-users@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 
 
 --
  Put Bad Developers to Shame
  Dominate Development with Jenkins Continuous Integration
  Continuously Automate Build, Test  Deployment
  Start a new project now. Try Jenkins in the cloud.
  http://p.sf.net/sfu/13600_Cloudbees
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 
 


--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Install under Win 7

2014-04-11 Thread Paul Hobson
You should be using conda to install matplotlib:

conda create --name mpl33 matplotlib python=3.3 ipython-notebok
source activate mpl33


On Fri, Apr 11, 2014 at 8:11 AM, grivet gri...@cnrs-orleans.fr wrote:

 Under Win7pro, I have tried to install matplotlib by running either
 matplotlib-1.3.0.win32-py3.3.exe or
 matplotlib-1.3.1.win32-py3.3.exe. In each case, the installer tells
 pythion-3.3 is not in the registry (although
 Anaconda was successfully installed previousle). A pop-up window then
 opens, asking me for the python
 and installation directories. It proves impossible to write anything in
 this window.
 Does anybody know what's wrong in my set up ?
 TIA for any help
 JP Grivet*



 --
 Put Bad Developers to Shame
 Dominate Development with Jenkins Continuous Integration
 Continuously Automate Build, Test  Deployment
 Start a new project now. Try Jenkins in the cloud.
 http://p.sf.net/sfu/13600_Cloudbees
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Install under Win 7

2014-04-11 Thread Paul Hobson
You're on windows, so that last command is just activate mpl33


On Fri, Apr 11, 2014 at 7:05 PM, Paul Hobson pmhob...@gmail.com wrote:

 You should be using conda to install matplotlib:

 conda create --name mpl33 matplotlib python=3.3 ipython-notebok
 source activate mpl33


 On Fri, Apr 11, 2014 at 8:11 AM, grivet gri...@cnrs-orleans.fr wrote:

 Under Win7pro, I have tried to install matplotlib by running either
 matplotlib-1.3.0.win32-py3.3.exe or
 matplotlib-1.3.1.win32-py3.3.exe. In each case, the installer tells
 pythion-3.3 is not in the registry (although
 Anaconda was successfully installed previousle). A pop-up window then
 opens, asking me for the python
 and installation directories. It proves impossible to write anything in
 this window.
 Does anybody know what's wrong in my set up ?
 TIA for any help
 JP Grivet*



 --
 Put Bad Developers to Shame
 Dominate Development with Jenkins Continuous Integration
 Continuously Automate Build, Test  Deployment
 Start a new project now. Try Jenkins in the cloud.
 http://p.sf.net/sfu/13600_Cloudbees
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Variable size markers legend formatting

2014-04-09 Thread Paul Hobson
On Wed, Apr 9, 2014 at 9:00 AM, Adam Hughes hughesada...@gmail.com wrote:

 Thanks.  That's probably the way I'll go.  At first, I thought creating
 separate legend markers and removing them from the plot seemed hacky, but I
 guess there's no way that matplotlib could know which legend size I want.
  I wonder if there'd be any interest in a PR to add a keyword to legend to
 handle this situation?


Why not just work the other way around with proxy artists. IOW, make the
artists but never add them to the plot.

http://matplotlib.org/users/legend_guide.html?highlight=proxy%20artists#using-proxy-artist
(works with Line2D artists)

-p




 On Wed, Apr 9, 2014 at 1:44 AM, Sterling Smith smit...@fusion.gat.comwrote:

 Adam,

 I haven't investigated, but does the discussion of the legend marker at
 [1] help?

 -Sterling

 [1]
 https://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg25200.html

 On Apr 8, 2014, at 3:44PM, Adam Hughes wrote:

  Hello,
 
  I've been searching but can't seem to find this topic addressed
 (perhaps wrong search terms)
 
  Simply put, I have a scatter plot with variable size markers, and I'd
 like to have the markers all be a single size in the legend.  Is there a
 standard way to do this?
 
  Thanks.
 
 --
  Put Bad Developers to Shame
  Dominate Development with Jenkins Continuous Integration
  Continuously Automate Build, Test  Deployment
  Start a new project now. Try Jenkins in the cloud.
 
 http://p.sf.net/sfu/13600_Cloudbees___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Put Bad Developers to Shame
 Dominate Development with Jenkins Continuous Integration
 Continuously Automate Build, Test  Deployment
 Start a new project now. Try Jenkins in the cloud.
 http://p.sf.net/sfu/13600_Cloudbees
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test  Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Is there interrest for an implementation of colour maps visualising small differences around 0

2014-03-14 Thread Paul Hobson
Pål,

Matplotlib already has a jet colormap and has moved away from using it as
the default for the very reasons listed in the first paper you site. How is
your jet colormap different? Can you provide a comparison with the existing
colormap? Does it overcome the drawbacks listed in the Sandia Nat'l Labs
paper?
-paul


On Fri, Mar 14, 2014 at 3:16 AM, Pål Gunnar Ellingsen paa...@gmail.comwrote:

 Hi

 I've created a python method for making a jet colour map which clearly
 shows small changes around a given point in the colour map, (i.e. the
 opposite of a diverging colour map
 http://www.sandia.gov/~kmorel/documents/ColorMaps/ ).
 This looks something like figure four on:
 http://biomedicaloptics.spiedigitallibrary.org/article.aspx?articleid=1828750

 If this is something that is interesting for implementation in matplotlib,
 I would be happy to clean up my code and submit a patch with it?

 Kind regards

 Pål


 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/13534_NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] multiplot in a for loop

2014-03-10 Thread Paul Hobson
Gabriele,

I'm confused. I only see 1 series in each subplot. Could you trim your
example down into some code that we can copy, paste, and run? A more
thorough description of the problem might help too.
-p


On Mon, Mar 10, 2014 at 9:39 AM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi I'm trying to do a particular plot similar to this one:
 http://matplotlib.org/examples/pylab_examples/line_styles.html

 but my code pastes different datas in the same plot. I want only one array
 per each plot. I attach the wrong result

 fdatas = plt.figure()
 for filename in filenames:

 [various things]

 for obsangl in angles:
   [various things]

   #fitspectrum4.fitSpec is one my personal
 fitting routine

   pa0, era0, pa1, era1, pa2, era2, pa3, era3 =
 fitspectrum4.fitSpec(eels, averspe, (1.0)*(10**(-8)), 0.66, 10**6, 1)
   GAMMAs.append(pa1)
   EcutS.append(pa2)
   Bees.append(pa3)
   GeR.append(era1)
   EeR.append(era2)
   beR.append(era3)

   ialph += 1
   ialpg = ialph
   axum1 = fdatas.add_subplot(numalp, 3, ialpg)
   da1 = axum1.errorbar(angles, GAMMAs, yerr=GeR, marker = .)

   ialpg = ialph + 1
   axum2 = fdatas.add_subplot(numalp, 3, ialpg)
   da2 = axum2.errorbar(angles, EcutS, yerr=EeR, marker = .)

   ialpg = ialph + 2
   axum3 = fdatas.add_subplot(numalp, 3, ialpg)
   da3 = axum3.errorbar(angles, Bees, yerr=beR, marker = .)



 thanks

 Gabriele


 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/13534_NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] multiplot in a for loop

2014-03-10 Thread Paul Hobson
So it sounds like you're not specifying the subplots correctly.

I recommend using `fig, axes = plt.subplots(nrows=R, ncols=C)` as a
replacement for `fig = plt.figure` and `fig.add_subplot()`.

`axes` will be a numpy array of Axes objects through which you'll be able
to loop along with your other variable.

Good luck.
-paul


On Mon, Mar 10, 2014 at 10:46 AM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 No, if you look better near the zero there are some COLOURED lines: you
 have this impression because the values in EcutS are enormous respect the
 other one in GAMMAs and Bees. When you plot them all together the other
 ones disappear... I don't want to plot them all together.

 Excuse me but it's very difficult for me to give you a self running code:
 it's an enormous code with a lot of things that recall each others...

 Thanks

 Gabriele


 2014-03-10 12:54 GMT-04:00 Paul Hobson pmhob...@gmail.com:

 Gabriele,

 I'm confused. I only see 1 series in each subplot. Could you trim your
 example down into some code that we can copy, paste, and run? A more
 thorough description of the problem might help too.
 -p


 On Mon, Mar 10, 2014 at 9:39 AM, Gabriele Brambilla 
 gb.gabrielebrambi...@gmail.com wrote:

 Hi I'm trying to do a particular plot similar to this one:
 http://matplotlib.org/examples/pylab_examples/line_styles.html

 but my code pastes different datas in the same plot. I want only one
 array per each plot. I attach the wrong result

 fdatas = plt.figure()
 for filename in filenames:

 [various things]

 for obsangl in angles:
   [various things]

   #fitspectrum4.fitSpec is one my personal
 fitting routine

   pa0, era0, pa1, era1, pa2, era2, pa3, era3
 = fitspectrum4.fitSpec(eels, averspe, (1.0)*(10**(-8)), 0.66, 10**6, 1)
   GAMMAs.append(pa1)
   EcutS.append(pa2)
   Bees.append(pa3)
   GeR.append(era1)
   EeR.append(era2)
   beR.append(era3)

   ialph += 1
   ialpg = ialph
   axum1 = fdatas.add_subplot(numalp, 3, ialpg)
   da1 = axum1.errorbar(angles, GAMMAs, yerr=GeR, marker =
 .)
   ialpg = ialph + 1
   axum2 = fdatas.add_subplot(numalp, 3, ialpg)
   da2 = axum2.errorbar(angles, EcutS, yerr=EeR, marker =
 .)
   ialpg = ialph + 2
   axum3 = fdatas.add_subplot(numalp, 3, ialpg)
   da3 = axum3.errorbar(angles, Bees, yerr=beR, marker = .)



 thanks

 Gabriele


 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and
 their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/13534_NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow for .png- low resultion

2014-03-05 Thread Paul Hobson
Olga Botnivik is doing some work with these types of figures in her fork of
the seaborn project.
Example here: http://nbviewer.ipython.org/gist/olgabot/8341784
Link to the PR in github: https://github.com/mwaskom/seaborn/pull/73

Those might be a good place to start.



On Wed, Mar 5, 2014 at 12:19 PM, Asma Riyaz asmariya...@gmail.com wrote:

 Hi
 I am trying to merge a heat map(matplotlib) with a tree(.png), but the
 .png does not plot as needed or for that matter cannot be seen easily. Here
 is my code:

 ### CODE
  cmap = mpl.cm.hot
 if outlier==0:
threshold=1
 else:
threshold=outlier-0.01

 fig = plt.figure(figsize=(25,25))
 plt.suptitle(file_handle.replace('.csv',''),fontsize=22)
 cmap.set_over('green')
 cmap.set_under('grey')
 gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
 ,width_ratios=[1,1,-2,2])
 phyl_ax=plt.subplot(gs[0],frameon=False)
 ht_ax=plt.subplot(gs[1])
 ##gs.tight_layout(fig, rect=[1,1,2,2])
 ht_ax.set_xlim(0,35)
 ht_ax.set_ylim(0,35)
 ##ht_ax.grid(color='white',linestyle='-',linewidth=1)
 fig.subplots_adjust(hspace=0)
 cb_ax,kw =mpl.colorbar.make_axes(ht_ax, shrink=0.65)


 plt.setp(phyl_ax.get_xticklabels(),visible=False)
 plt.setp(phyl_ax.get_yticklabels(),visible=False)
 plt.setp(ht_ax.get_xticklabels(),visible=True)
 plt.setp(ht_ax.get_yticklabels(),visible=True)
 plt.setp(phyl_ax.get_xticklines(),visible=False)
 plt.setp(phyl_ax.get_yticklines(),visible=False)
 plt.setp(ht_ax.get_xticklines(),visible=True)
 plt.setp(ht_ax.get_yticklines(),visible=True)


 img = ht_ax.imshow(data, cmap=cmap,
 interpolation='none',vmax=threshold)
 cb = mpl.colorbar.ColorbarBase(ax=cb_ax,cmap=cmap,
 extend='neither',**kw)
 cb.cmap.set_over('green')
 image_file =
 cbook.get_sample_data('/home/asmariyaz/Desktop/mytree.png',asfileobj=False)
 image = plt.imread(image_file)

 How can I make the resolution of the .png image better OR for that matter
 is there a better solution to merge these together?

 I am attaching the plot I am getting with this code- (WrongTree.pdf)

 Thanks
 Asma


 --
 Subversion Kills Productivity. Get off Subversion  Make the Move to
 Perforce.
 With Perforce, you get hassle-free workflows. Merge that actually works.
 Faster operations. Version large binaries.  Built-in WAN optimization and
 the
 freedom to use Git, Perforce or both. Make the move to Perforce.

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


--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Loding CSV file and plotting histogram of a particular column

2014-02-28 Thread Paul Hobson
Sounds like you want to use pandas, not numpy.

import pandas
import matplotlib.pyplot as plt
df = pandas.read_csv('myfile.txt', sep='\t')
plt.hist(data['A'], bins=30)

...should do it for you.


On Fri, Feb 28, 2014 at 11:06 AM, AR12 aarthi.re...@gmail.com wrote:

 Hi,

 I have a csv file where head -5 looks like this:

 A  B   C
 100  0.45  0.3
 67  0.25  0.4
 50.6  0.2  0.6
 56.4  0.4  0.3

 The columns are tab separated. I want to load this CSV file and plot the
 histogram of the third or second column. I was able to load the csv file
 using this:
 data=csv2rec('Downloads/Sample.txt',delimiter='\t',skiprows=0)
 The file has 2792 rows including the top header row.

 When I do
  data['A'] I get this error:
 ---
 ValueErrorTraceback (most recent call last)
 ipython-input-19-856828b8eaa3 in module()
  1 data['A']


 /Library/Python/2.7/site-packages/numpy-1.9.0.dev_297f54b-py2.7-macosx-10.9-intel.egg/numpy/core/records.pyc
 in __getitem__(self, indx)
 457
 458 def __getitem__(self, indx):
 -- 459 obj = ndarray.__getitem__(self, indx)
 460 if (isinstance(obj, ndarray) and obj.dtype.isbuiltin):
 461 return obj.view(ndarray)

 ValueError: field named A not found

 First is data['A'] supposed to read the whole A column? Once I read the
 column I want to be able to plot it. Can I simply do
  hist(data['A'],bins=30) or something like that.

 Many thanks,
 AR




 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Loding-CSV-file-and-plotting-histogram-of-a-particular-column-tp42938.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 Flow-based real-time traffic analytics software. Cisco certified tool.
 Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
 Customize your own dashboards, set traffic alerts and generate reports.
 Network behavioral analysis  security monitoring. All-in-one tool.

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

--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] grid of subplot

2014-02-23 Thread Paul Hobson
You're not adding your subplot to an existing figure, so a new one is
created.

put fig = plt.figure(...) at the top of your script and replace axii =
plt.subplot(numalp, numobs, axisNum) with axii = fig.add_subplot(numalp,
numobs, axisNum)


On Sat, Feb 22, 2014 at 5:28 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi,
 I'm trying to follow this example to make a grid of subplot:

 http://matplotlib.org/examples/pylab_examples/line_styles.html

 but my code plot the two rows in two different figures (i attach them but
 I don't know if they are useful). Does anyone understand why?

 this is an extract of my code:

 alphas = [45, 75]
 numalp = len(alphas)

 angles = np.linspace(pi/12, pi/2, num=10)
 numobs = len(angles)

 axisNum = 0

 for a in alphas:

   #[some operations]

   for obsangl in angles:

#[some operations]

axisNum += 1
axii = plt.subplot(numalp, numobs, axisNum)
plt.errorbar(g, Pgamma, yerr = ePgamma, color =
 'green', fmt = '.')
axii1 = axii.twinx()
plt.plot(g, lightcurva, 'b-')
axii.set_yticklabels([])
axii.set_xticklabels([])
axii1.set_yticklabels([])
axii1.set_xticklabels([])





 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

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


--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [os x] Can't get IPython to use latest version of matplotlib

2014-02-21 Thread Paul Hobson
It appears that you have two different version of python installed (Apple's
2.7.3 and python.org's 2.7.5). You have to install all third-party packages
to the correct one. It appears pip in acting on Apple's python.


On Fri, Feb 21, 2014 at 2:08 PM, Timothy Duly timdu...@gmail.com wrote:

 Hello,

 I recently upgraded matplotlib, which was relatively simple:

 sudo pip install matplotlib --upgrade

 I checked to make sure I did indeed upgrade:

 [~]$ python
 Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43)
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
 Type help, copyright, credits or license for more information.
  import matplotlib; matplotlib.__version__
 '1.3.1'

 Success.  However, when I do the same in IPython, I get the old version:

 [~]$ ipython --pylab
 Python 2.7.5 (default, Aug 25 2013, 00:04:04)
 Type copyright, credits or license for more information.
 IPython 1.2.0 -- An enhanced Interactive Python.
 ? - Introduction and overview of IPython's features.
 %quickref - Quick reference.
 help  - Python's own help system.
 object?   - Details about 'object', use 'object??' for extra details.
 Using matplotlib backend: MacOSX
 In [1]: import matplotlib; matplotlib.__version__
 Out[1]: '1.1.1'

 Anyone know why this is the case?  How do I point IPython to the newest
 version of matplotlib?

 I tried googling, but wasn't sure how to zero in on the answer with a
 search.  Also, I'm not sure if this question is best suited for IPython
 people.

 Thanks,
 Tim


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

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


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-18 Thread Paul Hobson
Try specifying the color explicitly from the palette object:
import numpy as np
import matplotlib.pyplot as plt
import pandas
import seaborn

myPalet1 = seaborn.color_palette(RdPu_r, 10)
seaborn.set_color_palette(myPalet1)
x = np.linspace(start=0, stop=5, num=100)
fig, ax = plt.subplots()
for n, slope in enumerate(np.linspace(start=0, stop=5, num=10)):
ax.plot(x, slope*x**2, color=myPalet1[n])


On Tue, Feb 18, 2014 at 10:30 AM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi,
 I get right one plot, but this other one works in a strange way:

 it restarts to give the darker color to a line. I would like to assign the
 colors in the right order so the colorblind guy that works with me could
 see the differences like a light growing. (I attach the image) do you
 understand where am I doing wrong? (before this piece of code I use other
 color palette but I think they have no effect on the following ones)

 zipPARApha = zip(Pampli, Pgamma, Pecut, Pb, g)

 myPalet1 = sns.color_palette(RdPu_r, 10)
 sns.set_color_palette(myPalet1)
 lotgr = plt.figure()
 axius = lotgr.add_subplot(111)
 for n, (a1,b1,c1,d1,pha) in enumerate(zipPARApha):
if n % 18 == 0:
   fittedval = spock(logeels, a1, b1, c1, d1)
   phaint = int(pha)
   angli = str(phaint)
   imig = axius.plot(logeels, fittedval, label=angli)

 axius.set_title('phase resolved spectra, ' + lightitle)
 axius.set_ylim([-100, 1])
 axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)
 lotgr.canvas.draw()

 thanks

 Gabriele


 2014-02-18 10:47 GMT-05:00 Gabriele Brambilla 
 gb.gabrielebrambi...@gmail.com:

 it works, thank you.

 Using a color palette that changes only the intensity/light of the color
 (all blue lines) helps.

 Gabriele


 2014-02-17 20:57 GMT-05:00 Paul Hobson pmhob...@gmail.com:

 Untested, of course, but I would do something like this:

 import matplotlib.pyplot as plt
 import seaborn

 N = len(As)

 myPallette = seaborn.color_palette(skyblue, N)  # use the name of  any
 mpl colormap here
 seaborn.set_color_pallette(myPallette)

 zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)
 lotgr = plt.figure()
 axius = lotgr.add_subplot(111)

 for a1,b1,c1,d1,angol in zipPARA:
 fittedval = spock(logeels, a1, b1, c1, d1)
 angli = str(angol)
 imig = axius.plot(logeels, fittedval, label=angli)

 axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)
 lotgr.canvas.draw()


 On Mon, Feb 17, 2014 at 3:00 PM, Gabriele Brambilla 
 gb.gabrielebrambi...@gmail.com wrote:

 Hi, I would like to set the color of the different plots with seaborn
 but I don't find examples of this kind on the tutorial.
 How could I modify this code? the zip() arguments are lists of the same
 dimension.

 zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)

 lotgr = plt.figure()

 axius = lotgr.add_subplot(111)

 for a1,b1,c1,d1,angol in zipPARA:

 fittedval = spock(logeels, a1, b1, c1, d1)

 angli = str(angol)

 imig = axius.plot(logeels, fittedval, label=angli)

 axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)

 lotgr.canvas.draw()

 thanks

 Gabriele


 2014-02-17 14:46 GMT-05:00 Paul Hobson pmhob...@gmail.com:

 Adam,

 Look into the seaborn project:

 http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

 it's easy enough to define your own color palettes or select existing
 ones.
 -paul


 On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes 
 hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors 
 could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.comwrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the
 plt.text, as in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when
 trying to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have
 a try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib]
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42886i=0
  wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion

Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Paul Hobson
Adam,

Look into the seaborn project:
http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

it's easy enough to define your own color palettes or select existing ones.
-paul


On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text, as
 in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when trying
 to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a
 try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:
 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.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: colorbllind 
 problemhttp://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884p42886.html
 Sent from the matplotlib - users mailing list 
 archivehttp://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.htmlat 
 Nabble.com.


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

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




 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

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



Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Paul Hobson
Untested, of course, but I would do something like this:

import matplotlib.pyplot as plt
import seaborn

N = len(As)

myPallette = seaborn.color_palette(skyblue, N)  # use the name of  any
mpl colormap here
seaborn.set_color_pallette(myPallette)

zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)
lotgr = plt.figure()
axius = lotgr.add_subplot(111)

for a1,b1,c1,d1,angol in zipPARA:
fittedval = spock(logeels, a1, b1, c1, d1)
angli = str(angol)
imig = axius.plot(logeels, fittedval, label=angli)

axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)
lotgr.canvas.draw()


On Mon, Feb 17, 2014 at 3:00 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi, I would like to set the color of the different plots with seaborn but
 I don't find examples of this kind on the tutorial.
 How could I modify this code? the zip() arguments are lists of the same
 dimension.

 zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)

 lotgr = plt.figure()

 axius = lotgr.add_subplot(111)

 for a1,b1,c1,d1,angol in zipPARA:

 fittedval = spock(logeels, a1, b1, c1, d1)

 angli = str(angol)

 imig = axius.plot(logeels, fittedval, label=angli)

 axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)

 lotgr.canvas.draw()

 thanks

 Gabriele


 2014-02-17 14:46 GMT-05:00 Paul Hobson pmhob...@gmail.com:

 Adam,

 Look into the seaborn project:

 http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

 it's easy enough to define your own color palettes or select existing
 ones.
 -paul


 On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text,
 as in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when
 trying to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a
 try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] 
 [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.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

Re: [Matplotlib-users] plotting two functions on the same figure but with two different scales on y axis

2014-02-14 Thread Paul Hobson
Hey Gabriele,

See this example here:
http://stackoverflow.com/questions/14762181/adding-a-y-axis-label-to-secondary-y-axis-in-matplotlib/14762601#14762601


On Fri, Feb 14, 2014 at 12:32 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi,

 I'm trying to plot two functions on the same errorbar picture like the
 code below:

 fmlp = plt.figure()

 axop = fmlp.add_subplot(111)

 insp = axop.errorbar(g, Pampli, yerr = ePampli, fmt = '.')
 ins1 = axop.errorbar(g, lightcurva, yerr = zeros, fmt = 'x')

 axop.set_title('amplitudes for phases')

 fmlp.canvas.draw()

 but the two functions has a very different range in y values (one near
 10^-15 one near 1): how could I use two different scale (one per function)
 on the same plot?

 thanks


 --
 Android apps run on BlackBerry 10
 Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
 Now with support for Jelly Bean, Bluetooth, Mapview and more.
 Get your Android app in front of a whole new audience.  Start now.

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


--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Documentation for mpl_toolkits.basemap

2014-02-13 Thread Paul Hobson
It's not the wrong place, per se. But I think if you created an issue on
the github repository, it's less likely to get lost in the ether.
https://github.com/matplotlib/basemap


On Wed, Feb 12, 2014 at 7:17 PM, Roman Olson roman.ol...@unsw.edu.auwrote:

  Hi All,

 I am new to this list so I apologize if this is supposed to be posted
 somewhere else.

 Just wanted to report that there is missing documentation in
 mpl_toolkits.basemap Basemap for a couple of keyword arguments, namely
 o_lon_p and o_lat_p.

 (If this is the wrong place to post this please let me know an email to
 report problems or bugs).

 Cheers,
 -Roman

  Roman Olson
 Postdoctoral Research Associate
 Climate Change Research Centre
 University of New South Wales


 --
 Android apps run on BlackBerry 10
 Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
 Now with support for Jelly Bean, Bluetooth, Mapview and more.
 Get your Android app in front of a whole new audience.  Start now.

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


--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting a series of 3d quadrilaterals as a wireframe

2014-02-05 Thread Paul Hobson
Not quite sure exactly what you need to do, but it sounds like separate
calls to `plot` for each quadrilateral will do the trick.
-paul


On Wed, Feb 5, 2014 at 4:57 PM, Pedro Marcal pedrovmar...@gmail.com wrote:

 I don't know how to separately plot the quadrilaterals after plotting each
 of them in a closed loop eg nodes 1,2,3,4,1 the next quad is 3,2,5,6,3 say.
 I use a return to 1,0.0,3 and continue the curve numpy curve X,Y,Z as per
 the example tutorials. I tried inserting a None in between the quads, but
 this raises a python error. Please advise me on how to plot my quads
 without having to trace a sequence of previously plotted sides, eg 1,2,3
 then the second quad.
 Thanks,
 Pedro


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

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


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2014-01-09 Thread Paul Hobson
As the error message says, the problem is on Line 14:

print f.variables['WWSWHGT_P0_L1_GLL0']

a KeyError means that you tried to access an element that is not in a
dictionary. In this case f.variables is the dictionary and '
WWSWHGT_P0_L1_GLL0' is the element.

Did your data and script come of the same place? You can't just throw any
basemap script at any grid file.


On Thu, Jan 9, 2014 at 4:52 AM, Rolling Six surfersh...@hotmail.com wrote:

 Hi im new to Python and basemap i am trying to follow the script below that
 was posted in another thread  here
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-data-td19588.html
 but im getting this error

 alec@alec-imedia-S2870:~$ python Desktop/test.py
 /usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py:2: UserWarning:
 Module
 dap was already imported from None, but /usr/lib/python2.7/dist-packages is
 being added to sys.path
   __import__('pkg_resources').declare_namespace(__name__)
 a
 fatal: environment variable not set
 b
 ['VGRD_P0_L1_GLL0', 'WVDIR_P0_L1_GLL0', 'lon_0', 'PERSW_P0_L1_GLL0',
 'WIND_P0_L1_GLL0', 'PERPW_P0_L1_GLL0', 'WDIR_P0_L1_GLL0', 'forecast_time0',
 'DIRPW_P0_L1_GLL0', 'WVPER_P0_L1_GLL0', 'DIRSW_P0_L1_GLL0',
 'HTSGW_P0_L1_GLL0', 'UGRD_P0_L1_GLL0', 'lat_0']
 Traceback (most recent call last):
   File Desktop/test.py, line 14, in module
 datavar = f.variables['WWSWHGT_P0_L1_GLL0']
 KeyError: 'WWSWHGT_P0_L1_GLL0'

 The script im trying to run below

 import Nio
 from mpl_toolkits.basemap import Basemap
 import matplotlib.pyplot as plt
 import numpy as np
 f = Nio.open_file('akw.t00z.grib.grib2')
 print f.variables.keys()
 lons = f.variables['lon_0'][:]
 # flip latitudes so data goes S--N
 lats = f.variables['lat_0'][::-1]
 times = f.variables['forecast_time0'][:]
 datavar = f.variables['WWSWHGT_P0_L1_GLL0']
 ntime = 10
 data = datavar[ntime,::-1]
 print f.variables['WWSWHGT_P0_L1_GLL0']
 print data.min(), data.max()
 m = Basemap(projection='cyl',llcrnrlat=lats[0],llcrnrlon=lons[0],\
 urcrnrlat=lats[-1],urcrnrlon=lons[-1],resolution='l')
 x, y = m(*np.meshgrid(lons, lats))
 levels = np.arange(0,9.1,0.5)
 m.contourf(x,y,data,levels)
 m.drawcoastlines()
 m.fillcontinents()
 m.drawparallels(np.arange(40,81,10),labels=[1,0,0,0])
 m.drawmeridians(np.arange(150,241,10),labels=[0,0,0,1])
 m.drawparallels(np.arange(40,81,10),labels=[1,0,0,0])
 m.drawmeridians(np.arange(150,241,10),labels=[0,0,0,1])
 plt.title(datavar.long_name+' %s hr fcst'%(times[ntime]),fontsize=12)
 plt.colorbar(orientation='horizontal',shrink=0.9,format=%g)
 plt.show()







 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2014-01-09 Thread Paul Hobson
I think you posted the same image in both cases. Without seeing the
problematic image, I can only guess that it's caused by the resolution of
your data.


On Thu, Jan 9, 2014 at 7:58 AM, A Short surfersh...@hotmail.com wrote:

 Hi Paul,

 Thanks for your reply, I managed to fix it after I realised the mistake I
 was making.

 I've currently got a new problem. If you look at the image below, there's a
 lot of white showing up around the coasts which ideally I'd like to remove.
 The map is drawn using basemap, is there a function/feature that will fill
 this in. Or is it a probem with the grib files that I'm using?

 http://matplotlib.1069221.n5.nabble.com/file/n42701/figure_1.png

 If possible, I'd like it to look like the image below. If it is a problem
 with our data, is there a way that we can draw a layer of colour on the
 bottom to get rid of the white?

 http://matplotlib.1069221.n5.nabble.com/file/n42701/figure_1.png



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42701.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2014-01-09 Thread Paul Hobson
What I'm saying is that your top image and bottom image are identical and I
don't see any white boxes in either. What is the resolution of the grid?

-paul


On Thu, Jan 9, 2014 at 11:59 AM, A Short surfersh...@hotmail.com wrote:

 ok the file im using is this multi_2.glo_30m.t06z.grib2 from  here
 ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20140109/
 im
 not sure its the right file to get wave heights of the North East Atlantic
 so im trying different ones.

 as you can see above in the top image there is some data missing (white
 boxes) near the coast im wondering if its possible to either zoom into the
 map slightly so the data runs underneath the land..?

 Thanks
 Alec



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42705.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2014-01-09 Thread Paul Hobson
How does it look if you remove the calls to `m.drawcoastlines()` and `
m.fillcontinents()`?


On Thu, Jan 9, 2014 at 1:05 PM, A Short surfersh...@hotmail.com wrote:

 Thats strange they look different on this browser. Hopefully the one below
 youll see what i mean

 Thanks

 http://matplotlib.1069221.n5.nabble.com/file/n42708/figure_1.png



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42708.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2014-01-09 Thread Paul Hobson
Looks like it's just a coarse resolution to me. Try showing the data as an
image with no iterpolation.


On Thu, Jan 9, 2014 at 3:26 PM, A Short surfersh...@hotmail.com wrote:

 Ive also changed the grib file from multi_2.glo_30m.t06z.grib2 to
 nww3.t12z.grib.grib2 i still cant figure out which is the right file for
 the
 North East Atlantic neither...i wonder if my data source is wrong..?

 http://matplotlib.1069221.n5.nabble.com/file/n42710/figure_2.png





 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42710.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Interative legend manipulation?

2014-01-07 Thread Paul Hobson
I believe (as of v1.3.1) that after you create the legend you call
leg.draggable(True)
http://matplotlib.org/api/legend_api.html#matplotlib.legend.Legend.draggable



On Tue, Jan 7, 2014 at 6:37 AM, Skip Montanaro s...@pobox.com wrote:

 Sometimes the legend simply gets in the way. You can't always guess
 the correct placement (think generic tool which processes lots of
 different input data sets), or zooming/panning makes it obscure a
 chunk of the plot you want to look at. Is it possible to move it
 interactively? I'm using mpl 1.3.1.

 Thx,

 Skip


 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Paul Hobson
Adam,

Not sure if this is the try you're trying to bark up, but I've used a total
hack to do what I think you're describing:
 1) store lists of coordinate pairs in a pandas DataFrame
 2) use df.apply() to turn each list of coords in to a patch and add to an
axes object

I'm sure you know this, but for posterity's sake, I'll mention that you
*really* should only store primitives in pandas DataFrames. For that reason
alone, I would describe the method above as the death-throes of a failing
project trying to meet deadlines.

Perhaps a more robust way would be to store the coordinates in a long
format, i.e.,

shapeid, vertexid, x, y
1,1,0,0
1,2,1,1
1,3,2,2
2,1,10,10
2,2,11,11
3,3,12,12
...

And the group that DataFrame by `shapeid` and use `apply` on the pandas
GroupBy object to construct a patch and add it to an axes object.

Just a thought.


On Tue, Jan 7, 2014 at 12:29 PM, Adam Hughes hughesada...@gmail.com wrote:

 Sorry, quick followup.  I did find the gallery example to plot multiple
 patches together:

 http://matplotlib.org/examples/api/patch_collection.html

 That's excellent.  Now I guess my question is how best to generalize the
 process of turning my objects into patches.  I think I will just try to
 keep the geometry (ie line -- mpatch.Line) unless anyone has any better
 suggestions.

 Thanks!


 On Tue, Jan 7, 2014 at 3:08 PM, Adam Hughes hughesada...@gmail.comwrote:

 Hi,

 I am working on a library for image analysis which stores particles as
 indexed numpy arrays and provides functionality for managing the particles
 beyond merely image masking or altering the arrays directly.  I've already
 designed classes for many common shapes including Lines/Curves,
 Circles/Ellipses, Polygons, Multi-shapes (eg 4 circles with variable
 overlap).

 What I'd really LOVE to do would be able to generate a
 matplotlib.Collection instance from these objects as generally as possible.
  Then, I'd be able to show data as a masked image, but also get a really
 nice looking plot from the objects in their Collection representation.

 So my question really is in the implementation.  First, is there a
 general collection object that could work with ANY shape, or am I better
 off matching my shape to that collection?  For example:

 line -- LineCollection   *vs.*line -- GeneralCollection
 circle -- CircleCollection   circle --- GeneralCollection

 And then, is the Collections plotting API flexible enough to mix all of
 these types together?  Or would I have to settle for only being able to
 plot a collection of any 1 shape type at at time?

 I will delve into the API further, but ascertaining this information
 would really help me get started.

 Thanks




 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Nanoseond timestamp on x axis

2013-12-19 Thread Paul Hobson
Here are a couple of examples of using custom formats:
http://matplotlib.org/examples/api/date_index_formatter.html
http://matplotlib.org/examples/pylab_examples/date_demo2.html

And here's a link with all of the possible formatting strings:
http://www.tutorialspoint.com/python/time_strftime.htm


On Thu, Dec 19, 2013 at 1:19 AM, Alexandru Popa a.ephe...@gmail.com wrote:

 I need to plot some large csv files that contain financial data with
 timestamps that have nanosecond precision.

 Is there a way to make matplotlib show these timestamps as dates with
 nanosecond precision?

 If not, is there a way to plot my data by sending the timestamps, and then
 set a formatter that will show the timestamp based on a custom format of my
 choosing?

 Note that I'm embedding matplotlib in a wxPython application, and I am not
 familiar with the ipython way  of working with matplotlib.


 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Normalizing Marker Size in Legend

2013-12-05 Thread Paul Hobson
Matthew,

I think you're on the right track. You need proxy artists of some sort. You
can create Line2D objects directly, never add them to the figure, and then
use those to create the legend.

An alternatively/hacky approach I often use is to the plot all the real
data with '_nolegend' labels, get my current (or desired) axes limits, then
plot the negative value of my data with the symbology I want in the legend
and restore my original axes limits. This works for me b/c I'm always
dealing with rainfall or water quality data, so negative values aren't
really a thing for me to worry about. The concept is solid though:
1) plot the data (no labels)
2) record axes limit
3) plot fake data far away from real data with legend-appropriate symbology
4) restore axes limits
5) create legend.





On Wed, Dec 4, 2013 at 3:48 PM, Matthew Niznik matthew.nizn...@gmail.comwrote:

 Hi all,

 I have a plot in which I have 15 markers, each with a separate size
 (created by calls to plot()). Because of this, the legend also shows
 variable size by default but I'd like all markers in the legend to have the
 same size.

 I'm looking for an alternative to manually calling plot again with a
 standardized marker size (say 10.0) but plotting offscreen or with NANs.
 Thoughts I had were to either change the marker sizes after the legend is
 drawn (but it seems very difficult to update a legend post-creation) or to
 copy the handles and change the size that way (but I've yet to figure out
 how to make a hard copy of the plot handles). Any solutions?

 --
 Matthew Niznik


 --
 Sponsored by Intel(R) XDK
 Develop, test and display web and hybrid apps with a single code base.
 Download it for free now!

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


--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] axes labelling

2013-11-23 Thread Paul Hobson
Hey Sourav,

This example should demonstrate the basics of setting xticks and xticklabels
http://matplotlib.org/examples/ticks_and_spines/ticklabels_demo_rotation.html



On Sat, Nov 23, 2013 at 4:27 AM, Sourav Chatterjee srv@gmail.comwrote:

 Hi, I have simple xy plot using below.

 import matplotlib.pyplot as pl

 pl.plot([2005.8,2005.4,2005.2,2005,2004.9,2004.8,2004.7,2004.6,2004.5,2004.4,2004.3,2004.2,2004.1,2004],[33.2637,32.4243,58.271,89.3454,21.7372,31.6301,36.6301,13.117,31.6689,17.6246,7.4627,8.7094,5.782,6.3461],'ko-')

 pl.axis([2004,2005.8,0,100])
 pl.show()

 I want on my x-axis only the points specified in pl.plot. Is there any way?
 --
 thanks
 Sourav


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up
 now.
 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] indicating directions on stereographic projection.

2013-11-06 Thread Paul Hobson
On Wed, Oct 23, 2013 at 9:30 PM, Sourav Chatterjee srv@gmail.comwrote:

 Hello,

 I have stereographic projection of the pole. I need to indicate the
 directions like north,south,east, west, north-east, north-west and so on.
 Is there any way to do so?

 Thanks
 Sourav


I am **very far** from a GIS expert, but I believe that the cardinal
directions are ambiguous at the poles. In other words, if you're standing
on the North Pole, it'd difficult to head in any direction that's not
towards the south pole.

Curious to hear if I'm wrong, though.

-paul
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] x axis non-uniform labeling (KURT PETERS)

2013-10-01 Thread Paul Hobson
On Mon, Sep 30, 2013 at 4:50 PM, KURT PETERS petersk...@msn.com wrote:

 That doesn't seem to fix it.  What I'm expecting is at the top, 28 should
 correspond to the value -2.  Instead it puts a 30 there.
 Kurt



It's not really clear to me what you're trying to do. But the rounding of
the axes limits is an expected behavior of matplotlib. You can set them
manually if you like. Also, I think this achieves what you want and is much
simpler.


import numpy as np
import matplotlib.pyplot as plt

xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])


fig, (ax1, ax2) = plt.subplots(nrows=2, sharey=True)

ax1.plot(xdat,idatanp)
ax2.plot(simtimedata, idatanp,'k--')
ax2.set_xlim([simtimedata.min(), simtimedata.max()])

fig.tight_layout()
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] x axis non-uniform labeling (KURT PETERS)

2013-09-30 Thread Paul Hobson
On Mon, Sep 30, 2013 at 1:43 PM, KURT PETERS petersk...@msn.com wrote:

 I'm including the code below to demonstrate the problem.  The top should
 have simtimedata (0 through 28) labeling the points.  As you can see,
 MATPLOTLIB just distributes those values evenly instead of assigning them
 properly.
 Any ideas?

 #!/usr/bin/env python
 import numpy as np
 from matplotlib import rc
 import matplotlib.pyplot as plt
 import matplotlib.mlab as mlab
 import re
 from matplotlib.ticker import EngFormatter
 xdat=np.arange(1,11)
 simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
 idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
 print idatanp.shape
 print simtimedata.shape
 print xdat.shape
 fig = plt.figure()

 ax1 = fig.add_subplot(211)
 ax1.plot(xdat,idatanp)
 ax2 = fig.add_subplot(212)
 #ax1.plot(x1, x1,'b--')
 ax3 = ax2.twiny()
 ax2.plot(xdat, idatanp.real,'k-o')
 ax3.plot(simtimedata, idatanp,'k--',alpha=0)
 ax2.set_title(time domain)
 ax2.grid(True)
 plt.show()

 
  I'm trying to find a glitch in an FPGA simulation. The data stored in a
 file is:
  (simulation time, y)
 
  In reality, if I plot that I get large gaps because the simulation time
 continues and data is only output periodically. In other words simulation
 time is not continuous. I'd like to view the data without the gaps, but
 with simulation time annotating the x-axis so I can determine where the
 glitch occurs.
  I've tried a variety of things:
  #ax1.plot(x1, x1,'b--')
  #ax3 = ax2.twiny()
  ax2.set_xticklabels(simtimedata, fontdict=None, minor=False, rotation =
 45)
  ax2.plot( idatanp.real,'k--',idatanp.imag,'g.-')
  #ax2.plot(xdat, idatanp.real,'k--',xdat,idatanp.imag,'g.-')
  #ax3.plot(simtimedata, idatanp.real,'k--',alpha=0)
 
  but cannot get the axis to both show the data all together AND show
 where the glitch occurs. I thought the twiny might help to put another x
 axis up so I could plot the data first with the x axis incrementing based
 on when the data is read in, and then trying to place labels showing
 simulation time.
 
  Does anyone have any ideas how I could do this?
  Kurt


Kurt,

You need to show ax3's xticklabels somewhere. Like this:
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import re
from matplotlib.ticker import EngFormatter
xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])


fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.plot(xdat,idatanp)

ax2 = fig.add_subplot(212)
ax3 = ax2.twiny()

ax2.plot(xdat, idatanp.real,'k-o')
ax3.plot(simtimedata, idatanp,'k--',alpha=0)

 #  show ax3's xticklabels
ax3.xaxis.tick_top()
ax2.set_title(time domain)
ax2.grid(True)
fig.tight_layout()
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] I have a Mac!

2013-08-16 Thread Paul Hobson
Mike,

That's great news. Is there any chance we can look forward to official
instructions for setting up a Mac to develop matplotlib?

I gave up a long time ago and started piecing to together my meager PRs in
a linux VM.
-paul


On Fri, Aug 16, 2013 at 6:52 AM, Michael Droettboom md...@stsci.edu wrote:

 Thanks to the gracious donation from Hans Petter Langtangen and the
 Center for Biomedical Computing at Simula (http://home.simula.no/~hpl),
 I now have a new Mac Mini sitting at my desk.  This should allow me to
 keep on top of changes that affect the Mac builds and to better track
 down Mac-only issues.

 Stay tuned over the next few weeks and months as we will most likely be
 using some more of these funds to pay for hosted continuous integration
 services (as discussed yesterday in our MEP19 Google Hangout).

 Cheers,
 Mike




 --
 Get 100% visibility into Java/.NET code with AppDynamics Lite!
 It's a free troubleshooting tool designed for production.
 Get down to code-level detail for bottlenecks, with 2% overhead.
 Download for free and get started troubleshooting in minutes.
 http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with 2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font in figures needs to load a specific latex package \usepackage{tipa}

2013-07-25 Thread Paul Hobson
On Thu, Jul 25, 2013 at 12:16 PM, Jeffrey Spencer jeffspenc...@gmail.comwrote:

 I want to use IPA vowel labels in my figures and to do that I need to load
 the package in latex \usepackage{tipa}. Is this possible as searching
 online besides using the new backend pgf I haven't seen how to manually
 select latex packages to load when using tex. Is this possible?


You can set the tex preample without using the pgf backend. Here's how
I'm setup:


impot matplotlib
matplotlib.rcParams['text.usetex']
Out[12]: True

matplotlib.rcParams['text.latex.preamble']
Out[13]:
['\\usepackage{siunitx}',
 '\\sisetup{detect-all}',
 '\\usepackage{helvet}',
 '\\usepackage{sansmath}',
 '\\sansmath']
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Asking for help modifying a matplot windrose graphic using Python (:

2013-07-22 Thread Paul Hobson
Guilherme,

Check out my implementation of windroses here:
https://github.com/phobson/python-metar/blob/master/metar/graphics.py#L138


On Mon, Jul 22, 2013 at 11:54 AM, Guilherme Araújo Martins 
gami...@globo.com wrote:

 Hello guys.
 I'm having a problem with a matplot graphic and I guess it can be easy for
 Python experts to solve. Hope I'm not out of topic here.

 Basically, I'm using this code...
 http://matplotlib.org/examples/pylab_examples/polar_bar.html

 ... but I want to turn it in something like this graphic over here...
 http://www.weathersa.co.za/web/images/articles/windrose.png

 You see, where more than one bar pointing the same direction will be put
 one over the other (the biggest in the base and the smallest at the top). I
 assumed I had to put some function at this part of the code:

 bars = ax.bar(theta, radii, width=width, bottom=0.0)

 Turning Bottom into a function call somewhat related to the radii (bar
 size) if both bars have the same theta (angle). Point is I'm having some
 trouble doing that. I'm totally stuck, actually.

 If not a complete solution, some tip would be apreciated.

 Thank you very much!


 --
 See everything from the browser to the database with AppDynamics
 Get end-to-end visibility with application monitoring from AppDynamics
 Isolate bottlenecks and diagnose root cause in seconds.
 Start your free trial of AppDynamics Pro today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] savefig

2013-06-14 Thread Paul Hobson
On Thu, Jun 13, 2013 at 11:40 PM, Sudheer Joseph
sudheer.jos...@yahoo.comwrote:

 Thank you,
 I don't see a way other than starting in normal mode as the moment I type
 plot command it get displayed and I don't need to do a show command.


In the qtconsole, you can enter multi-line mode with crtl+enter.
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] full grid for 2nd y-axis wit twinx() ?

2013-06-14 Thread Paul Hobson
On Thu, Jun 13, 2013 at 1:33 PM, Daniel Mader 
danielstefanma...@googlemail.com wrote:

 Hi Paul,

 I've modified your suggestion a little, since I don't want a grid for the
 primary axis at all -- unfortunately to no avail, i.e. no grid line at all:

 import numpy

 import matplotlib

 matplotlib.use('agg')

 import matplotlib.pyplot as plt


 datax = numpy.arange(50)

 data1 = numpy.sin(datax)*1.5

 data2 = datax**2


 plt.close('all')


 fig = plt.figure()

 ax1 = fig.add_subplot(111)

 ax2 = ax1.twinx()


 ax1.plot(datax, data1, 'x')

 ax2.plot(datax, data2, '--')


 #for ax in [ax1, ax2]:

 # ax.xaxis.grid(True, which='both') # `which` can be 'minor', 'major', or
 'both'

 # ax.yaxis.grid(True, which='both')


 ax2.xaxis.grid(True, which='both')

 ax2.yaxis.grid(True, which='both')


 fig.savefig('twinxgrid.png')

 #fig.show()



Try throwing this in there:

ax1.xaxis.grid(False, which='both')

ax1.yaxis.grid(False, which='both')
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] full grid for 2nd y-axis wit twinx() ?

2013-06-13 Thread Paul Hobson
On Thu, Jun 13, 2013 at 4:47 AM, Daniel Mader 
danielstefanma...@googlemail.com wrote:

 Hi,

 I need a twinx() plot with horizontal and vertical grid lines for the
 second axis, just like the usual grid for the first axis. I don't need or
 want to specify the ticks manually, though!

 My example code just produces horizontal lines:

 import pylab


 datax = pylab.arange(50)

 data1 = pylab.sin(datax)*1.5

 data2 = datax**2


 pylab.close('all')


 fig = pylab.figure()

 ax1 = fig.add_subplot(111)

 ax2 = ax1.twinx()


 ax1.plot(datax, data1, 'x')

 ax2.plot(datax, data2, '--')


 #ax1.grid()

 ax2.grid()


 fig.show()


 Thanks in advance!


Does this get you where you want to be?

import pylab

datax = pylab.arange(50)
data1 = pylab.sin(datax)*1.5
data2 = datax**2

pylab.close('all')

fig = pylab.figure()
ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()

ax1.plot(datax, data1, 'x')
ax2.plot(datax, data2, '--')

for ax in [ax1, ax2]:
ax.xaxis.grid(True, which='both') # `which` can be 'minor', 'major', or
'both'
ax.yaxis.grid(True, which='both')

fig.show()
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] time axis format

2013-06-10 Thread Paul Hobson
In that case, I would use ax.tick_params(...) to make the font smaller.


On Sat, Jun 8, 2013 at 7:36 AM, Sudheer Joseph sudheer.jos...@yahoo.comwrote:

 Dear Paul,
The issue I am facing is like in the attached plot where
 the month naming get cluttered.
 with best regards,
 Sudheer

 ***
 Sudheer Joseph
 Indian National Centre for Ocean Information Services
 Ministry of Earth Sciences, Govt. of India
 POST BOX NO: 21, IDA Jeedeemetla P.O.
 Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
 Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
 E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com
 Web- http://oppamthadathil.tripod.com
 ***

   --
  *From:* Sudheer Joseph sudheer.jos...@yahoo.com
 *To:* Paul Hobson pmhob...@gmail.com
 *Cc:* matplotlib-users@lists.sourceforge.net 
 matplotlib-users@lists.sourceforge.net
 *Sent:* Saturday, 8 June 2013 7:46 PM

 *Subject:* Re: [Matplotlib-users] time axis format

 Thank you Paul for the helping hand,
   However I was looking for slightly
 different solution like in the attached plots. I used ferret to do this
 based on the length of the time axis it chose the mode of labelling. for
 example in case of 2 year plot it made month labeling as j f m etc and in
 case of 1 year as there is enough space on x axis it made jan feb etc with
 single label of year.

 In the attached python plot (ATser_RAMA_HYCOM_U_8n90e.png) every tick
 point is lablled for year, which I wanted to avoid and get plots similar to
 the first types thought it is not done automatically but at least manually.



 ***
 Sudheer Joseph
 Indian National Centre for Ocean Information Services
 Ministry of Earth Sciences, Govt. of India
 POST BOX NO: 21, IDA Jeedeemetla P.O.
 Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
 Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
 E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com
 Web- http://oppamthadathil.tripod.com
 ***

   --
  *From:* Paul Hobson pmhob...@gmail.com
 *To:* Sudheer Joseph sudheer.jos...@yahoo.com
 *Cc:* matplotlib-users@lists.sourceforge.net 
 matplotlib-users@lists.sourceforge.net
 *Sent:* Friday, 7 June 2013 8:50 PM
 *Subject:* Re: [Matplotlib-users] time axis format




 On Thu, Jun 6, 2013 at 11:39 PM, Sudheer Joseph 
 sudheer.jos...@yahoo.comwrote:

 Dear Experts,
 I have been experimenting with the plot_dates option of
 matplotlib to plot time series data and have below questions

  I have used
 loc = mdates.AutoDateLocator()
 ax.xaxis.set_major_locator(loc)
 ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b\n %Y'))


 and got the tick labels in attached plot

 However I feel the repeatd year labeling is not needed here and it is
 required once in a year only , Also if I need to plot long time seris
 insted of MAR APR I wanted to get them reduced to M A etc so that
 the lavel congestion can be avoided.


 I notice that below options are available, but was wondering how
 commbinatins of these locateors are used ie mark every month and every year
 once each.


 Is there a way to achive the above or does it need further development?

 fmt = mdates.DateFormatter('%Y-%m-%d')
 loc = mdates.WeekdayLocator(byweekday=mdates.MONDAY,interval=4)
 locator = mdates.YearLocator()


 If I were trying to do this, I'd cobble something together using by the
 minor and major formatters.
 e.g.,...
 import matplotlib.dates as mdates
 import matplotlib.pyplot as plt

 fig, ax = plt.subplots()

 majorLocs = mdates.MonthLocator(bymonth[1,7])
 majorFmt = mdates.DateFormatter('%b\n%Y')

 minorLocs = mdates.MonthLocator(bymonth[1,7])
 minorFmt = mdates.DateFormatter('%b')

 ax.xaxis.set_major_locator(majorLocs)
 ax.xaxis.set_major_formatter(majorFmt)

 ax.xaxis.set_minor_locator(minorLocs)
 ax.xaxis.set_minor_formatter(minorFmt)





--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] time series

2013-06-05 Thread Paul Hobson
On Wed, Jun 5, 2013 at 9:13 AM, Sudheer Joseph sudheer.jos...@yahoo.comwrote:

 Dear Users,
  Is there any other method in matplotlib to get the plot
 similar to the one there in below link?


 http://dsnra.jpl.nasa.gov/software/Python/scikits/lib.plotting.examples.html
 I tried using this package but get below error.

 sjo@sjo-ltp../hourly_rama~$ python ts.py
 Traceback (most recent call last):
   File ts.py, line 12, in module
 fsp = fig.add_tsplot(111)
   File
 /usr/local/lib/python2.7/dist-packages/scikits.timeseries-0.91.3-py2.7-linux-x86_64.egg/scikits/timeseries/lib/plotlib.py,
 line 1284, in add_tsplot
 return add_generic_subplot(self, *args, **kwargs)
   File
 /usr/local/lib/python2.7/dist-packages/scikits.timeseries-0.91.3-py2.7-linux-x86_64.egg/scikits/timeseries/lib/plotlib.py,
 line 177, in add_generic_subplot
 if key in figure_instance._seen:
 AttributeError: 'TimeSeriesFigure' object has no attribute '_seen'

 

 import numpy as np
 import matplotlib.pyplot as plt
 import scikits.timeseries as ts
 import scikits.timeseries.lib.plotlib as tpl
 from scikits.timeseries.lib.moving_funcs import mov_average_expw

 # generate some random data
 data = np.cumprod(1 + np.random.normal(0, 1, 300)/100)
 series = ts.time_series(data,
start_date=ts.Date(freq='M', year=1982, month=1))
 fig = tpl.tsfigure()
 fsp = fig.add_tsplot(111)
 fsp.tsplot(series, '-', mov_average_expw(series, 40), 'r--')
 plt.show()


Pandas has excellent time series handling and plotting capabilities.
http://pandas.pydata.org/pandas-docs/stable/timeseries.html
http://pandas.pydata.org/pandas-docs/stable/visualization.html
--
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] why legend does not show in matplotlib-1.2.1 py2.7

2013-05-23 Thread Paul Hobson
Sorry I have to be so brief, but just like the error says, you fed the
legend function the wedges returned by the pie command. But legend can't
handle wedges. As the proxy artist tutorial hints, you need to feed it
rectangles created manually (i.e., outside of any plotting commands).

Hope that gets you started,
-paul


On Wed, May 22, 2013 at 8:06 AM, oyster lepto.pyt...@gmail.com wrote:

 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
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] missing ticks on inverted log axis

2013-05-15 Thread Paul Hobson
On Wed, May 15, 2013 at 3:48 PM, gaspra yes2...@gmail.com wrote:

 Hi, I am having troubles to correctly make a figure with inverted log axis.
 This is what I am doing:

 import numpy as np
 import matplotlib.pyplot as plt

 y=np.linspace(-90,90,20)
 z=np.arange(1,1.e4, 200)

 c=y.reshape(20,1)*z.reshape(1,len(z))

 fig,ax=plt.subplots()
 plt.pcolor(y,z,c.transpose())
 ax.set_yscale('log')
 ax.invert_yaxis()

 The problem is that the ticks of y axis is not displayed correctly once I
 invert the y axis. It shows the tick at 1000. All other ticks such as 100,
 10 and 1 are missing.  Am I doing something wrong or is this a bug in
 matplotlib?

 Thanks for your help.


This works fine on my system:
 In [3]: np.version.full_version

Out[3]: '1.7.1'


In [5]: matplotlib.__version__

Out[5]: '1.2.1'


Not sure what the issue could be.

-p
--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problems with sans-serif fonts and tick labels with TeX

2013-05-03 Thread Paul Hobson
On Fri, May 3, 2013 at 6:17 AM, Michael Droettboom md...@stsci.edu wrote:

  On 05/02/2013 03:16 PM, Paul Hobson wrote

  I now see that this was more of TeX issue than an MPL configuration
 issue. Your help prompted me to find this solution (similar to yours):
 mpl.rcParams['text.latex.preamble'] = [
r'\usepackage{siunitx}',   # i need upright \micro symbols, but you
 need...
r'\sisetup{detect-all}',   # ...this to force siunitx to actually
 use your fonts
r'\usepackage{helvet}',# set the normal font here
r'\usepackage{sansmath}',  # load up the sansmath so that math -
 helvet
r'\sansmath']  # - tricky! -- gotta actually tell tex to use!


 Wow.  That's some serious TeX voodoo magic!  Want to work that into an
 example that we could include in the docs?

 Cheers,
 Mike


Gladly. I'll try to find time to cook up PR building off of the existing
example over the weekend.
-paul
--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with 2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problems with sans-serif fonts and tick labels with TeX

2013-05-02 Thread Paul Hobson
On Thu, May 2, 2013 at 11:19 AM, Michael Droettboom md...@stsci.edu wrote:

  I think the confusion here stems from the fact that you're mixing TeX
 and non-TeX font commands.

 This turns on TeX mode, so all of the text is rendered with an external
 TeX installation:

 rc('text', usetex=True)

  In this line, setting it to sans-serif will get passed along to TeX, but
 a specific ttf font name can not be used by TeX, so the second part
 (involving Helvetica) is ignored.  And setting the default body text in TeX
 does not (by default) change the math font.  This is (unfortunately
 standard TeX behavior).

 rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})

 This affects the font set used by matplotlib's internal mathtext renderer,
 and has no effect on TeX:

 rc('mathtext', fontset='stixsans')

 The solution I use when I want all sans-serif out of TeX is to use the
 cmbright package, which can be turned on by adding:

 rc('text.latex', preamble=r'\usepackage{cmbright}')

 That may require installing the cmbright LaTeX package if you don't
 already have it.

 I know all this stuff is confusing, but providing a flat interface over
 both the internal text rendering and the TeX rendering isn't really
 possible -- they have different views of the world -- and I'm actually not
 sure it's desirable.  Though I wonder if we couldn't make it more obvious
 (somehow) when the user is mixing configuration that applies to the
 different contexts.

 Mike


Mike,

Thanks for the guidance. I know this stuff is complicated and the work
everyone has put into it to make it work is fantastic.

I now see that this was more of TeX issue than an MPL configuration issue.
Your help prompted me to find this solution (similar to yours):
mpl.rcParams['text.latex.preamble'] = [
   r'\usepackage{siunitx}',   # i need upright \micro symbols, but you
need...
   r'\sisetup{detect-all}',   # ...this to force siunitx to actually
use your fonts
   r'\usepackage{helvet}',# set the normal font here
   r'\usepackage{sansmath}',  # load up the sansmath so that math -
helvet
   r'\sansmath']  # - tricky! -- gotta actually tell tex to use!

Thanks again!
-paul
--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with 2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] windrose

2013-03-19 Thread Paul Hobson
On Tue, Mar 19, 2013 at 2:22 AM, Sudheer Joseph sudheer.jos...@yahoo.comwrote:

 Dear users,
  Attached is a windrose diagram created by using
 https://sourceforge.net/project/showfiles.php?group_id=239240package_id=290902.
  Can any one tell me if the numbers displayed in the attached plot is % of
 wind directions in each category? or are they represent some other numbers?


 http://3.bp.blogspot.com/_4ZlrnfU7IT8/TPxpftZGzfI/ADA/uq9cF3PTpR8/s1600/Wind_rose_plot.jpg



Sudheer,

That's correct. The total length of the bars is the percentage of time that
the wind is blowing *from* that direction.
See my implementation here:
https://github.com/phobson/python-metar/blob/master/metar/graphics.py#L135

Side note, you're emails are consistently formatted pretty strangely and
can be difficult to read. Perhaps stick with the same font that is in your
email signature?
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Aligning xticks and labels with WeekdayLocator

2013-03-19 Thread Paul Hobson
On Mon, Mar 18, 2013 at 8:34 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:

 Matplotlib 1.2.0, Windows Vista, Python 3.3.0.  I want the first major
 xtick label aligned with the first date that's plotted.  This never
 happens with the value of day below set in the range zero to six.  The
 first major tick label actually occurs as follows.

 Day Label date
 0   25/03/2013
 1   02/04/2013
 2   10/04/2013
 3   21/03/2013
 4   29/03/2013
 5   06/04/2013
 6   17/03/2013

 What am I doing wrong?

 If day is set to seven then no xticks are displayed but labels for
 14/03/2013 and 13/03/2014 are displayed.  I expected a ValueError or
 similar using this number.  Could you explain this behaviour please?

 import matplotlib.pyplot as plt
 from matplotlib.ticker import FormatStrFormatter, MultipleLocator
 from matplotlib.dates import DateFormatter, WeekdayLocator
 import datetime

 dates = [datetime.date(2013, 3, 14), datetime.date(2014, 3, 13)]
 values = [0, 1]
 plt.ylabel('Balance')
 plt.grid()
 ax = plt.subplot(111)
 plt.plot_date(dates, values, fmt = 'rx-')
 plt.axis(xmin=dates[0], xmax=dates[-1])
 day = ?
 ax.xaxis.set_major_locator(WeekdayLocator(byweekday=day, interval=4))
 ax.xaxis.set_minor_locator(WeekdayLocator(byweekday=day))
 ax.xaxis.set_major_formatter(DateFormatter('%d/%m/%y'))
 ax.yaxis.set_major_formatter(FormatStrFormatter('£%0.2f'))
 ax.yaxis.set_minor_locator(MultipleLocator(5))
 plt.setp(plt.gca().get_xticklabels(), rotation = 45, fontsize = 10)
 plt.setp(plt.gca().get_yticklabels(), fontsize = 10)
 plt.show()


Mark,

I've found that rotation_mode='anchor' works best when rotation != 0

So that makes it:
plt.setp(plt.gca().get_xticklabels(), rotation = 45, fontsize = 10,
 rotation_mode='anchor' )

HTH,
-paul
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Aligning xticks and labels with WeekdayLocator

2013-03-19 Thread Paul Hobson
On Tue, Mar 19, 2013 at 11:30 AM, Paul Hobson pmhob...@gmail.com wrote:

 On Mon, Mar 18, 2013 at 8:34 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:

 Matplotlib 1.2.0, Windows Vista, Python 3.3.0.  I want the first major
 xtick label aligned with the first date that's plotted.  This never
 happens with the value of day below set in the range zero to six.  The
 first major tick label actually occurs as follows.

 Day Label date
 0   25/03/2013
 1   02/04/2013
 2   10/04/2013
 3   21/03/2013
 4   29/03/2013
 5   06/04/2013
 6   17/03/2013

 What am I doing wrong?

 If day is set to seven then no xticks are displayed but labels for
 14/03/2013 and 13/03/2014 are displayed.  I expected a ValueError or
 similar using this number.  Could you explain this behaviour please?

 import matplotlib.pyplot as plt
 from matplotlib.ticker import FormatStrFormatter, MultipleLocator
 from matplotlib.dates import DateFormatter, WeekdayLocator
 import datetime

 dates = [datetime.date(2013, 3, 14), datetime.date(2014, 3, 13)]
 values = [0, 1]
 plt.ylabel('Balance')
 plt.grid()
 ax = plt.subplot(111)
 plt.plot_date(dates, values, fmt = 'rx-')
 plt.axis(xmin=dates[0], xmax=dates[-1])
 day = ?
 ax.xaxis.set_major_locator(WeekdayLocator(byweekday=day, interval=4))
 ax.xaxis.set_minor_locator(WeekdayLocator(byweekday=day))
 ax.xaxis.set_major_formatter(DateFormatter('%d/%m/%y'))
 ax.yaxis.set_major_formatter(FormatStrFormatter('£%0.2f'))
 ax.yaxis.set_minor_locator(MultipleLocator(5))
 plt.setp(plt.gca().get_xticklabels(), rotation = 45, fontsize = 10)
 plt.setp(plt.gca().get_yticklabels(), fontsize = 10)
 plt.show()


 Mark,

 I've found that rotation_mode='anchor' works best when rotation != 0

 So that makes it:
 plt.setp(plt.gca().get_xticklabels(), rotation = 45, fontsize = 10,
  rotation_mode='anchor' )

 HTH,
 -paul



I misread your question. Try setting your x-axis limits after defining the
locators and formatters.
-p
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread Paul Hobson
On Fri, Mar 15, 2013 at 8:01 AM, Christophe BAL projet...@gmail.com wrote:

 Hello,
 I really appreciate the work done by matplotlib but I really think that
 the interface must evolve. Here is a small example.

 *object.set_something(...)*
 *object.get_something()*

 It could be easier to use a jQuery like style as in the following lines.

 *object(...)*
 *object()*

 This will considerably simplify things.


 Here is a more realistic example.

 *fig = pylab.figure()*
 *ax  = fig.add_subplot(1,1,1)*
 *
 *
 *ax.set_xlabel(*xLabel*)*
 *ax.set_ylabel(*yLabel*)*

 The a jQuery like style would be as in the following lines.

 *fig = pylab.figure()*
 *ax  = fig.add_subplot(1,1,1)*
 *
 *
 *ax(xlabel = *xLabel*, ylabel = *yLabel*)*
 *
 *
 I don't know enough matplotlib to propose other examples
 but I really think that there is a lot of things that could make
 matplotlib much more Pythonicly easy to use.


Interesting thoughts, Christophe. There is currently a MEP to do something
similar:
https://github.com/matplotlib/matplotlib/wiki/MEP13
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] boxplot

2013-03-14 Thread Paul Hobson
On Thu, Mar 14, 2013 at 12:40 AM, paul.czodrow...@merckgroup.com wrote:

 Dear Matplotlibbers,

 I'm running matplotlib 1.1.0 and would like to plot pairs of values,
 e.g.
 [[0.27,0.43],[0.17,0.35]]

 When using boxplot, the values of the pairs correspond to the outer
 whiskers, but I would like that the interquartile ranges correspond to the
 value pairs. The whiskers shall NOT be shown.

 The rationale behind the value pairs: these pairs correspond to confidence
 intervals, and I would like to compare confidence intervals from different
 measurements and thought that matplotlib could help me.



 Cheers  Thanks,
 Paul


You lost me. Are you trying to create box and whisker plots or do you just
want rectangles? N = 2 is awfully small dataset for box/whisker plots. If
all you want are the rectangles -- use those directly:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

data = np.array([[0.27,0.43],[0.17,0.35]])
fig, ax = plt.subplots()
box_width = 0.5
for pos, row in enumerate(data):
xy = (pos+1, np.min(row))
box_height = np.max(row) - np.min(row)
box = Rectangle(xy, box_width, box_height, facecolor='white',
edgecolor='black', linewidth=1.5)
ax.add_patch(box)

ax.set_xlim([0, pos+2])
ax.set_ylim([0, data.max()*1.25])
plt.show()
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] data format question

2013-03-06 Thread Paul Hobson
On Wed, Mar 6, 2013 at 2:00 PM, Clifford Lyon clifford.l...@gmail.comwrote:

 I wish to make a boxplot with data in this format:

 Value, Frequency
 0, 128329
 1, 20390
 2, 230
 3, 32
 4, 3

 etc.  Rather than expand this into a flat array, is there some way to pass
 in weights for values?  Some of the frequencies I'm working with are very
 large, and so the resulting arrays would be huge.  AFAIK, all the summary
 statistics I need for the plot can be computed from data in this form.


Boxplot, as it currently stands, wants the raw data. Some recently added
features allow you to manually specify the median and it's confidence
intervals, but nothing else.

I've been meaning to submit a PR for boxplot where it's split into the
public method and private drawing function that just takes a dictionary of
the values (R does this, IIRC). That wouldn't directly help you in this
situation, but you'd be one step closer.
-paul
--
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and remains a good choice in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] View datetime corresponding to x coordinate of cursor

2013-03-04 Thread Paul Hobson
On Mon, Mar 4, 2013 at 11:23 AM, William Furnass w...@thearete.co.ukwrote:

 Several backends will show you the x and y float values that
 correspond to the current cursor position in a plot() but are there
 backends that show the _datetime_ corresponding to the x position if
 the plotted data is a time series (e.g. a pandas.Series object with a
 DatetimeIndex)?

 Regards,

 Will


Will,

You can use the `format_coord` method of the axes objects to do just this.
-paul
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] changing the shade of a color depending on a value

2013-02-27 Thread Paul Hobson
On Wed, Feb 27, 2013 at 1:49 AM, Rita rmorgan...@gmail.com wrote:

 Hi,

 I am currently plotting cpu utilization over time (plot_time). I would
 like the color of my line to be red when at 100%. 80-90% a bit less red,
 more yellow, and lower numbers will be green. Any thoughts of doing this?


A few years ago, Gökhan Sever posted this technique, which is the simplest
and best I've seen:
##

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
x = np.linspace(0, 3 * np.pi, 5000)
y = np.sin(x)
z = np.cos(0.5 * (x[:-1] + x[1:])) # 1st derivative
cmap_z = cm.coolwarm(z)

fig, ax1 = plt.subplots(nrows=1, ncols=1)
ax1.scatter(x, y, c=cmap_z, marker='_', s=5)
fig.show()
##
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cross correlation

2013-02-27 Thread Paul Hobson
On Wed, Feb 27, 2013 at 1:01 AM, Sudheer Joseph sudheer.jos...@yahoo.comwrote:

 Dear Pierre,
 I was checking the plt.xcorr and it calls the
 np.correlate in side it. It calls np.correlate(ts1,ts2, mode=2).
 Is there a way to see which vector is sided back in time? ie
 ts1[t1,t2,t3,t4] ts2[t1,t2,t3,t4...]  ( ts2[t2] correlated with ts1[t1]
 or ts2[t1] is correlated with ts2[t2] ie {to make out which one is the
 cause and which is effect)
 in case of cross correlation it can be obtained by either sliding ts1 back
 in time or ts2 back in time. Is there a way to know this? I am not able to
 make much from np.correlate. Also is there a way to get 95% significance or
 p value from the xcorr.? in case of matlab? in matlab xcorr can be called
 with option of corcoeff instead of default cross correlation but is there
 similar option for matplotlib?
 sincerely.
 Sudheer


Sudheer:

It sounds like your needs are beyond the scope of matplotlib. It'll
probably be more productive to check in with the numpy or scipy mailing
lists.
-paul
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >