Re: [Matplotlib-users] Easiest way to create a chloropleth in Python

2014-10-24 Thread Christian Alis
Hi Ben,

Yes, indeed. I'm referring to a choropleth. :)

Thanks,

Christian
On Oct 24, 2014 8:23 PM, Benjamin Root ben.r...@ou.edu wrote:

 Do you mean choropleth? http://en.wikipedia.org/wiki/Choropleth_map

 On Fri, Oct 24, 2014 at 1:18 PM, ianalis iana...@gmail.com wrote:

 I have been creating chloropleth maps in Python by adding patches and/or
 polygons in a matplotlib Axes but I'm looking for something easier to use.

 Ideally, the interface should be similar to how contour maps or
 pseudocolor
 plots are created where, at the minimum, only one call to a function is
 needed to create these plots from data. Colors are automatically assigned
 and normalized based on values. A colorbar can then be added by calling
 another function.

 So far, the closest package seems to be geopandas. Is there an another
 package that is nearer to what I want? That is, is there a package that
 can
 make a (basic) chloropleth of values stored as a dictionary, numpy array
 or
 pandas dataframe in one call?

 I'm willing to contribute code and help develop the chloropleth capability
 of a package since I currently end up creating my own function and
 manipulating Axes internals just to create a chloropleth.



 --
 View this message in context:
 http://matplotlib.1069221.n5.nabble.com/Easiest-way-to-create-a-chloropleth-in-Python-tp44195.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] Plotting maps with matplotlib-basemap very slow

2015-01-24 Thread Christian Alis
Hi,

Have you considered reading from a suitably low-resolution shapefile
instead? I suppose overlays or colors change per generation but not
the geographical area.

Cheers,

Christian


On Sat, Jan 24, 2015 at 4:11 PM, Sappy85 robert.wittk...@gmx.de wrote:
 I would like to draw very, very simple maps of only europe in matplotlib /
 basemap, which takes very much time (around 10 seconds!). This is just
 unreal!? Setting of resolution is only l (low).
 I need to plot hundreds of those maps every few hours. This would be
 impossible!!? :(

 Here is the very simple code:

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

 m = Basemap(projection='stere',lon_0=5,lat_0=90.0,rsphere=6371200.,\

 llcrnrlon=-25.0,urcrnrlon=72.0,llcrnrlat=26.0,urcrnrlat=65.0,resolution='l')

 m.drawcoastlines(linewidth=0.2)
 m.drawcountries(linewidth=0.2)
 plt.savefig('/var/www/map.png')


 Hope you can help! :(

 Regards





 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Plotting-maps-with-matplotlib-basemap-very-slow-tp44755.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 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] Plotting style

2015-03-03 Thread Christian Alis
Hi Marin,

Have you looked at the style sheets examples in the gallery?

http://matplotlib.org/gallery.html#style_sheets

Regards,

Christian


On Tue, Mar 3, 2015 at 3:08 PM, Marin GILLES mrngil...@gmail.com wrote:
 Hello everyone,

 I was wondering if there would be some kind of plot style profile interface.
 What I mean, is that you could have mutliple files with different styles for
 plots, that would be used to change easily the style of plots.

 I know about the matplotlibrc but I am thinking of something a little bit
 more flexible, which could swicth between multiple “style sheets” easily.

 As an example, for now I use the Seaborn set_style capabilities to get
 better looking graphs.
 I previously used Prettyplotlib to make better plots.

 But with those two libraries, it does not seem to me that you can control
 your graph settings with, for example, a config file.

 Thank you


 --
 Marin GILLES
 PhD student CNRS
 Laboratoire Interdisciplinaire Carnot de Bourgogne (ICB)
 UMR 6303 CNRS - Université de Bourgogne
 9 av Alain Savary, BP 47870
 21078, Dijon (France)
 ☎ (+33)6.79.35.30.11
 ✉ marin.gil...@u-bourgogne.fr

 --
 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] A request for a Matplotlib extension to hist

2015-04-24 Thread Christian Alis
I had the same problem some time ago and what I did is to use bar() to
plot the histogram, which can be done in one line:

hist, bin_edges = np.histogram(data)
plt.bar(bin_edges[:-1], hist)

Perhaps this trick can be added in the documentation?

I am willing to code Virgil's request if many will find this useful.


On Fri, Apr 24, 2015 at 11:33 AM, Virgil Stokes v...@it.uu.se wrote:
 I have some Python (2.7.9) code that processes some rather large data sets
 to determine the curvatures along 2D curves. One feature of these data that
 I like to look at is the distribution of the curvatures. I use NumPy to to
 determine histograms for each set, and save the histogram parameters
 returned from numpy.histogram in a file.

 I would like to use Matplotlib to plot histograms from the parameters
 returned in NumPy and stored in a file --- why? Because the size of my data
 sets does not allow for the use of the histogram plot function in Matplotlib
 (1.4.3); i.e., it needs the data sets to calculate the histogram, before
 doing the plot. I would like to have a histogram plot function in Matplotlib
 that could bypass the actual calculation of the bin counts and edges from
 the data, and use values of these found a priori. Of course, an obvious
 question is -- Why not write code to plot the rectangles yourself? Yes, I
 could do this; but, why not extend the Matplotlib histogram class to allow
 for this option? If I better understood Matplotlib, I would try this myself.
 Maybe it is possible to get this into the next planned release (1.5). :-)

 If this request is inappropriate for this list, then please accept my
 apology and direct me to where I should send this request.

 Best regards.

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


--
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] unicode trouble

2015-07-06 Thread Christian Alis
Have you tried making the string unicode?

ax.set_xlabel (u' ')

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting from a data file

2015-08-14 Thread Christian Alis
According to 
http://matplotlib.org/1.4.3/api/cbook_api.html#matplotlib.cbook.get_sample_data,
msft.csv should be located at the mpl-data/sample_data directory.

In that case, save the following as sample.csv on the current directory:

event_start_time, event_duration, frequency_value, voice
0.0, 2.5, 60, 1
2.0, 1.5, 62, 4
4.0, 5.0, 64, 2
6.0, 3.5, 65, 3
8.0, 1.5, 67, 1
10.0, 2.0, 69, 4
12.0, 5.5, 71, 3
14.0, 3.0, 70, 2
16.0, 2.0, 72, 1
18.0, 1.0, 74, 4
20.0, 0.5, 75, 3
22.0, 1.5, 77, 2
24.0, 0.5, 79, 1

Then run the following code:

from pylab import plotfile, show, gca

#test 5; single subplot
plotfile('sample.csv', ('event_start_time', 'event_duration',
'frequency_value', 'voice'), subplots=False)

show()

Regards,

Christian


On Fri, Aug 14, 2015 at 6:05 PM, Kevin Parks k...@me.com wrote:
 Hi,

 That doesn’t work. Just having my own msft.csv file in my directory doesn't 
 change anything as it is still pointing to some other msft.csv someplace on 
 my computron. (what and where is this file?)

 I also have never opened a file this way. I had prevously just used something 
 like:

 for l in open(filename).readlines():
l = l.strip().split()
data.append([float(l[0]), float(l[1]), float(l[2]), int(l[3])])

 values = [1,2,3,4]

 -

 I think ithis is just some example file that gets installed some place so 
 that the examples work?

 What does asfileobj=False do?

 Goodness the whole world of Python has radically changed in the short time I 
 have been out of the game.



 On Aug 15, 2015, at 1:50 AM, Christian Alis iana...@gmail.com wrote:

 The sample code reads data from msft.csv. If you enter your data into
 a text editor and save it as msft.csv in python's current working
 directory, then the following minimal code (pruned from plotfile_demo)
 should work:

 from pylab import plotfile, show, gca
 import matplotlib.cbook as cbook

 fname = cbook.get_sample_data('msft.csv', asfileobj=False)

 #test 5; single subplot
 plotfile(fname, ('date', 'open', 'high', 'low', 'close'), subplots=False)

 show()



 --
 ___
 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] no plots showing

2015-11-27 Thread Christian Alis
You're missing a pair of parentheses. Without it, you're just referring to
the function itself.

plt.show()
On Nov 27, 2015 11:36 AM, "Paul Harrison" 
wrote:

>
> Hi guys,
>
> If I do the following, no plot shows:
>
> ply5@xroa-dt-20:~> python
>
> Python 2.6.9 (unknown, Apr  7 2015, 08:28:12)
>
> [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import pylab as plt
>
> >>> plt.figure()
>
> 
>
> >>> plt.hist([1.0,2,0])
>
> (array([ 1.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  1.]), array([ 0. ,
> 0.2,  0.4,  0.6,  0.8,  1. ,  1.2,  1.4,  1.6,  1.8,  2. ]),  Patch objects>)
>
> >>> plt.show
>
> 
>
> >>>
>
> I'm using SUSE Linux Enterprise 11 SP3 64-bit with python-matplotlib
> v1.3.1-70.11.
>
> Anyone have any ideas? I'm a bit of a matplotlib beginner so any advice is
> extremely welcome!
>
> Thanks,
>
> Paul
>
>
>
>
> --
>
> ___
> 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