You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(17) |
2
(3) |
3
(2) |
4
(11) |
5
(8) |
6
(22) |
7
(16) |
8
(9) |
9
(14) |
10
(1) |
11
(8) |
12
(5) |
13
(7) |
14
(10) |
15
(28) |
16
(8) |
17
(20) |
18
(6) |
19
(5) |
20
(15) |
21
(8) |
22
(7) |
23
(14) |
24
(10) |
25
(6) |
26
(8) |
27
(9) |
28
(11) |
29
(13) |
30
(20) |
|
Hello, I have problem to distinguish 10 colours generated with cm.hsv. import matplotlib.cm as cm for row in range(len(data)): bt = plt.bar(range(len(data[row])), data[row], width=width, color=cm.hsv(39*(row)), label=mutations_all[row], bottom=bottom) How is it possible to generate better colours in order to easier distinguish between the data? Thank you in advance.
Stupid mistake, My data array was wrong I had it just to rotate and now it is working. On Thu, Sep 29, 2011 at 2:01 PM, Michal <mic...@gm...> wrote: > Thank you for the links, but I had trouble to get them running with > Matplotlib 1.0.1. However, I downloaded the source code from the Matplotlib > book ( http://www.packtpub.com/support?nid=4110 ) and in chapter 9 is an > example (7900_09_04_cvs.py) with work with csv files. > > I have tried to modify the original code, because my data is stored in > dict. Please find below my problem code: > > import matplotlib.pyplot as plt > import matplotlib.cm as cm > import matplotlib.font_manager as font_manager > > > types = sorted(cul_stat.keys()) #year > print "types = ", types > data_info = {} > > for type in types: > for d in cul_stat[type]['Total'].data_info.keys(): > if d not in data_info: > data_info[d] = 0 > > data_info_all = sorted(data_info.keys()) > print "data_info_all = ", data_info_all #countries > > data = [] > for type in types: > data_amount = [] > for d in data_info_all: > try: > data_amount.append(cul_stat[type]['Total'].data_info[d]) > except KeyError: > data_amount.append(0) > > data.append(data_amount) > print 'data = ',data > > # prepare the bottom array > bottom = np.zeros(len(types)) > print "bottom = ", bottom > width = .8 > # for each line in data > for i in range(len(data)): > # create the bars for each element, on top of the previous bars > print "????", data[i], len(data[i]) > bt = plt.bar(range(len(data[i])), data[i], width=width, > color=cm.hsv(32*(i)), label=data_info_all[i], > bottom=bottom) > # update the bottom array > bottom += data[i] > > # label the X ticks with years > plt.xticks(np.arange(len(types))+width/2, types) > > # some information on the plot > plt.xlabel('Years') > plt.ylabel('Population (in billions)') > plt.title('World Population: 1950 - 2050 (predictions)') > > # draw a legend, with a smaller font > plt.legend(loc='upper left', > prop=font_manager.FontProperties(size=7)) > > plt.subplots_adjust(bottom=0.11, left=0.15) > plt.savefig('7900_09_04.png') > > > Output: > +++++++ > > types = ['d1', 'd2', 'd3', 'd4', 'd5'] > data_info_all = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9', > 'x10'] > data = [[484, 1, 2, 1119, 3, 570, 314, 0, 1185, 420], [3236, 6, 4, 8099, > 8, 3833, 2285, 3, 8054, 3170], [1396, 6, 2, 3588, 5, 1450, 1111, 3, 3478, > 1380], [492, 2, 1, 1257, 3, 528, 298, 2, 1240, 506], [21, 0, 0, 44, 1, 20, > 11, 0, 50, 17]] > > bottom = [ 0. 0. 0. 0. 0.] > ???? [484, 1, 2, 1119, 3, 570, 314, 0, 1185, 420] 10 > Traceback (most recent call last): > File "snp_density.py", line 196, in <module> > total_chr_overview(len_ref_seqs, cul_stat, args.chr) > File "snp_density.py", line 143, in total_chr_overview > bottom=bottom) > File > "/home/uqmlore1/apps/pymodules/lib/python2.7/site-packages/matplotlib/pyplot.py", > line 1908, in bar > ret = ax.bar(left, height, width, bottom, **kwargs) > File > "/home/uqmlore1/apps/pymodules/lib/python2.7/site-packages/matplotlib/axes.py", > line 4616, in bar > nbars) > AssertionError: incompatible sizes: argument 'bottom' must be length 10 or > scalar > +++++ > > What did I wrong? > > Thank you in advance. > > > > On Wed, Sep 28, 2011 at 5:13 PM, Klonuo Umom <kl...@gm...> wrote: > >> IMHO, when looking for basics and even more with intent to replicate some >> graph, it's easy to start by looking at matplotlib gallery: >> http://matplotlib.sourceforge.net/gallery.html and find best match. >> >> In you case: >> >> http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html >> http://matplotlib.sourceforge.net/examples/pylab_examples/table_demo.html >> >> for stacked bars, then look at code magic. >> >> I'm new user to matplotlib also, and was looking for easy way to create >> stacked bars some time ago, but unfortunately it's a bit more complicated >> than regular plot 'stuff'. I found gnuplot easier for stacked bars, but than >> as said my experience with matplotlib is basic >> >> >> Cheers >> >> >> On Wed, Sep 28, 2011 at 8:54 AM, Michal <mic...@gm...> wrote: >> >>> Hello, >>> I have found the following histogram example >>> http://gnuplot.sourceforge.net/demo/histograms.4.png >>> >>> which was created with the following gnuplot code: >>> http://gnuplot.sourceforge.net/demo/histograms.4.gnu >>> >>> and with this data set >>> >>> http://212.182.0.171/cgi-bin/dwww/usr/share/doc/gnuplot-doc/examples/immigration.dat >>> >>> How is it possible to do this with Matplotlib? >>> >>> Thank you in advance. >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> All the data continuously generated in your IT infrastructure contains a >>> definitive record of customers, application performance, security >>> threats, fraudulent activity and more. Splunk takes this data and makes >>> sense of it. Business sense. IT sense. Common sense. >>> http://p.sf.net/sfu/splunk-d2dcopy1 >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >
Thank you for the links, but I had trouble to get them running with Matplotlib 1.0.1. However, I downloaded the source code from the Matplotlib book ( http://www.packtpub.com/support?nid=4110 ) and in chapter 9 is an example (7900_09_04_cvs.py) with work with csv files. I have tried to modify the original code, because my data is stored in dict. Please find below my problem code: import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.font_manager as font_manager types = sorted(cul_stat.keys()) #year print "types = ", types data_info = {} for type in types: for d in cul_stat[type]['Total'].data_info.keys(): if d not in data_info: data_info[d] = 0 data_info_all = sorted(data_info.keys()) print "data_info_all = ", data_info_all #countries data = [] for type in types: data_amount = [] for d in data_info_all: try: data_amount.append(cul_stat[type]['Total'].data_info[d]) except KeyError: data_amount.append(0) data.append(data_amount) print 'data = ',data # prepare the bottom array bottom = np.zeros(len(types)) print "bottom = ", bottom width = .8 # for each line in data for i in range(len(data)): # create the bars for each element, on top of the previous bars print "????", data[i], len(data[i]) bt = plt.bar(range(len(data[i])), data[i], width=width, color=cm.hsv(32*(i)), label=data_info_all[i], bottom=bottom) # update the bottom array bottom += data[i] # label the X ticks with years plt.xticks(np.arange(len(types))+width/2, types) # some information on the plot plt.xlabel('Years') plt.ylabel('Population (in billions)') plt.title('World Population: 1950 - 2050 (predictions)') # draw a legend, with a smaller font plt.legend(loc='upper left', prop=font_manager.FontProperties(size=7)) plt.subplots_adjust(bottom=0.11, left=0.15) plt.savefig('7900_09_04.png') Output: +++++++ types = ['d1', 'd2', 'd3', 'd4', 'd5'] data_info_all = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9', 'x10'] data = [[484, 1, 2, 1119, 3, 570, 314, 0, 1185, 420], [3236, 6, 4, 8099, 8, 3833, 2285, 3, 8054, 3170], [1396, 6, 2, 3588, 5, 1450, 1111, 3, 3478, 1380], [492, 2, 1, 1257, 3, 528, 298, 2, 1240, 506], [21, 0, 0, 44, 1, 20, 11, 0, 50, 17]] bottom = [ 0. 0. 0. 0. 0.] ???? [484, 1, 2, 1119, 3, 570, 314, 0, 1185, 420] 10 Traceback (most recent call last): File "snp_density.py", line 196, in <module> total_chr_overview(len_ref_seqs, cul_stat, args.chr) File "snp_density.py", line 143, in total_chr_overview bottom=bottom) File "/home/uqmlore1/apps/pymodules/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1908, in bar ret = ax.bar(left, height, width, bottom, **kwargs) File "/home/uqmlore1/apps/pymodules/lib/python2.7/site-packages/matplotlib/axes.py", line 4616, in bar nbars) AssertionError: incompatible sizes: argument 'bottom' must be length 10 or scalar +++++ What did I wrong? Thank you in advance. On Wed, Sep 28, 2011 at 5:13 PM, Klonuo Umom <kl...@gm...> wrote: > IMHO, when looking for basics and even more with intent to replicate some > graph, it's easy to start by looking at matplotlib gallery: > http://matplotlib.sourceforge.net/gallery.html and find best match. > > In you case: > > http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html > http://matplotlib.sourceforge.net/examples/pylab_examples/table_demo.html > > for stacked bars, then look at code magic. > > I'm new user to matplotlib also, and was looking for easy way to create > stacked bars some time ago, but unfortunately it's a bit more complicated > than regular plot 'stuff'. I found gnuplot easier for stacked bars, but than > as said my experience with matplotlib is basic > > > Cheers > > > On Wed, Sep 28, 2011 at 8:54 AM, Michal <mic...@gm...> wrote: > >> Hello, >> I have found the following histogram example >> http://gnuplot.sourceforge.net/demo/histograms.4.png >> >> which was created with the following gnuplot code: >> http://gnuplot.sourceforge.net/demo/histograms.4.gnu >> >> and with this data set >> >> http://212.182.0.171/cgi-bin/dwww/usr/share/doc/gnuplot-doc/examples/immigration.dat >> >> How is it possible to do this with Matplotlib? >> >> Thank you in advance. >> >> >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >
Thanks JJ, `axes_grid1` seems to handle this issue On Wed, Sep 28, 2011 at 4:01 PM, Jae-Joon Lee <lee...@gm...> wrote: > > On Wed, Sep 28, 2011 at 3:32 PM, Klonuo Umom <kl...@gm...> wrote: > > How to deal with this, without manually positioning legends and if possible > > including all annotated plot lines in one legend? > > *twinx* creates a new axes. Thus there are TWO axes, and you need to > do some manual adjustment. I believe that the solution suggested by > Stephen George is essentially the best way, although you may try to > tweak things using the Axes.get_legend_handles_labels method ( > http://matplotlib.sourceforge.net/users/legend_guide.html#what-to-be-displayed > ). > > Alternatively, you can try the axes_grid1 toolkit which automatically > merges legends for you. Check out the example below. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#example-1-twinx > > Regards, > > -JJ
Thanks Stephen, but I'm not sure if I follow correctly: I used `twinx()` as I wanted "line 1" to be referenced on left Y-axis and "line 2" on right Y-axis. In your example I can't see what's the purpose of twinx() command? - It presents left Y-axis as default 0 to 1 values not referenced to any plot. On Wed, Sep 28, 2011 at 9:14 AM, Stephen George <ste...@op...>wrote: > On 28/09/2011 4:32 PM, Klonuo Umom wrote: > > Please consider: > > plot([1, 2, 3, 4], label='line 1') > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > > will draw only label for 'line 2' > > plot([1, 2, 3, 4], label='line 1') > legend() > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > > same result, as it will overwrite label 'line 1' with label 'line 2' > > How to deal with this, without manually positioning legends and if > possible including all annotated plot lines in one legend? > > > Thanks > > > I would do something like > > from matplotlib import pylab > > LegendText = [] > > pylab.twinx() # << had to move before first plot else it blew up > > pylab.plot([1, 2, 3, 4] ) > LegendText.append('line 1') > > pylab.plot([11, 12, 11, 14]) > LegendText.append('line 2') > > pylab.legend( LegendText , loc='lower right') > > pylab.show() > > > Don't know if there is a better way > Steve > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On 9/28/11 2:19 PM, Isidora wrote: > Hi Filipe, > > I have just seen your answers. I am trying to plot on a background GIF map, lines like the ones you can see in http://www.spc.noaa.gov/products/outlook/day1probotlk_2000_wind.gif. I can plot the lines as you see them in this link without a problem. However, because those lines are not closed polygons, the filling extends only to a straight line between first and last point of the curve. > I want the filling to extend all the way to the border of United States. > > Since drawcountries() return a Collection of paths without any metadata identifying the country/countries been separated by it, I cannot use it to mask the area outside ofthe borders out. > > I'd appreciate any link/documentation I could read to help me resolve this issue. > > Thank you Isidora Nobody has tried to do this (that I know of), so I can't point you to anything specific. Did you see my message about creating a gridded field (say 1's for points inside and 0's for points outside the region), the calling contour to draw the line? You can use the is_land method to determine if a point is over land or not, but there is not way to determine whether a given point is inside a country. As you found out, there is no metadata associated with the coastlines or political boundary lines. The fillcontinents method returns a list matplotlib polygon instances that represent the land areas. One of them is North America, and could be used to clip your line segments - but there is no easy way to determine which one it is. If you can find a shapefile that just contains a CONUS polygon, you could use that I suppose. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Hi Filipe, I have just seen your answers. I am trying to plot on a background GIF map, lines like the ones you can see in http://www.spc.noaa.gov/products/outlook/day1probotlk_2000_wind.gif. I can plot the lines as you see them in this link without a problem. However, because those lines are not closed polygons, the filling extends only to a straight line between first and last point of the curve. I want the filling to extend all the way to the border of United States. Since drawcountries() return a Collection of paths without any metadata identifying the country/countries been separated by it, I cannot use it to mask the area outside ofthe borders out. I'd appreciate any link/documentation I could read to help me resolve this issue. Thank you
Michael Droettboom <mdroe@...> writes: > > > the PDF image :/ > Can you send the PDF file to me (off-list)? It would be helpful to look > at the content of the file and see the nature of the failure. > > Mike > Done! Let me know if it doesn't arrive... -Dave
Hi Isidora, in the past I used the matlab function below for a similar task. Maybe it can be adapted to your problem. If you can provide a small sample of your problem I can try to implement that in python (it has been in my TODO list for a while, but i cannot promise.) http://woodshole.er.usgs.gov/operations/sea-mat/mapstuff-html/join_cst.m -Filipe On Wed, Sep 28, 2011 at 09:39, Jeff Whitaker <js...@fa...> wrote: > On 9/27/11 5:37 PM, Jeff Whitaker wrote: > > On 9/27/11 4:57 PM, Isidora wrote: > > The attached map shows plotted fill paths whose filling extends only to the > U.S. borders. Is there any way I could accomplish something like it using > Basemap? > > Thanks > > Isidora: > > It's probably possible, but there's no simple recipe. The drawcoastlines > method returns a LineCollection which you should be able to use to do what > you want. Sorry I can't be more specific, but I don't have time to go into > any more depth right now. > > -Jeff > > Isidora: Another option would be to create a gridded field defining the > area you would like to enclose, use contourf to draw the boundaries of the > region, then mask out the ocean areas with the maskoceans function. > > -Jeff > > ---------- Forwarded Message ---------- > From: "Isidora" <is...@ju...> > To: mat...@li... > Subject: matplotlib - fill open path inside U.S. borders > Date: 2011年9月26日 19:55:49 GMT > > Hi, > I am trying to plot filled paths over a U.S. map. I plot the given paths, > but since these are not closed paths, the filling is truncated at a line > drawn between last and first point in the path. I want to extend the path > to the United States border instead. > > > I am no expert in matplotlib or GIS. Could anyone help me find > documentation or blogs discussing this type of issue? I am convinced > somebody else has already faced this problem although I have not been able > to find any paper, documentation, blog on it. > > Thank you > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Wed, Sep 28, 2011 at 3:32 PM, Klonuo Umom <kl...@gm...> wrote: > How to deal with this, without manually positioning legends and if possible > including all annotated plot lines in one legend? *twinx* creates a new axes. Thus there are TWO axes, and you need to do some manual adjustment. I believe that the solution suggested by Stephen George is essentially the best way, although you may try to tweak things using the Axes.get_legend_handles_labels method ( http://matplotlib.sourceforge.net/users/legend_guide.html#what-to-be-displayed ). Alternatively, you can try the axes_grid1 toolkit which automatically merges legends for you. Check out the example below. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#example-1-twinx Regards, -JJ
On 9/27/11 5:37 PM, Jeff Whitaker wrote: > On 9/27/11 4:57 PM, Isidora wrote: >> The attached map shows plotted fill paths whose filling extends only to the U.S. borders. Is there any way I could accomplish something like it using Basemap? >> >> Thanks > Isidora: > > It's probably possible, but there's no simple recipe. The > drawcoastlines method returns a LineCollection which you should be > able to use to do what you want. Sorry I can't be more specific, but > I don't have time to go into any more depth right now. > > -Jeff Isidora: Another option would be to create a gridded field defining the area you would like to enclose, use contourf to draw the boundaries of the region, then mask out the ocean areas with the maskoceans function. -Jeff >> ---------- Forwarded Message ---------- >> From: "Isidora"<is...@ju...> <mailto:is...@ju...> >> To:mat...@li... <mailto:mat...@li...> >> Subject: matplotlib - fill open path inside U.S. borders >> Date: 2011年9月26日 19:55:49 GMT >> >> Hi, >> I am trying to plot filled paths over a U.S. map. I plot the given paths, but since these are not closed paths, the filling is truncated at a line drawn between last and first point in the path. I want to extend the path to the United States border instead. >> >> >> I am no expert in matplotlib or GIS. Could anyone help me find documentation or blogs discussing this type of issue? I am convinced somebody else has already faced this problem although I have not been able to find any paper, documentation, blog on it. >> >> Thank you >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Wednesday, September 28, 2011, Klonuo Umom <kl...@gm...> wrote: > Please consider: > > plot([1, 2, 3, 4], label='line 1') > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > will draw only label for 'line 2' > > plot([1, 2, 3, 4], label='line 1') > legend() > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > same result, as it will overwrite label 'line 1' with label 'line 2' > How to deal with this, without manually positioning legends and if possible including all annotated plot lines in one legend? > > Thanks Could you file a bug report on this on github? Unfortunately, I think the problem is going to be fairly complicated to solve. Thanks! Ben Root
On 28/09/2011 4:32 PM, Klonuo Umom wrote: > Please consider: > > plot([1, 2, 3, 4], label='line 1') > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > > will draw only label for 'line 2' > > plot([1, 2, 3, 4], label='line 1') > legend() > twinx() > plot([11, 12, 11, 14], label='line 2') > legend() > > > same result, as it will overwrite label 'line 1' with label 'line 2' > > How to deal with this, without manually positioning legends and if > possible including all annotated plot lines in one legend? > > > Thanks > I would do something like from matplotlib import pylab LegendText = [] pylab.twinx() # << had to move before first plot else it blew up pylab.plot([1, 2, 3, 4] ) LegendText.append('line 1') pylab.plot([11, 12, 11, 14]) LegendText.append('line 2') pylab.legend( LegendText , loc='lower right') pylab.show() Don't know if there is a better way Steve
IMHO, when looking for basics and even more with intent to replicate some graph, it's easy to start by looking at matplotlib gallery: http://matplotlib.sourceforge.net/gallery.html and find best match. In you case: http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html http://matplotlib.sourceforge.net/examples/pylab_examples/table_demo.html for stacked bars, then look at code magic. I'm new user to matplotlib also, and was looking for easy way to create stacked bars some time ago, but unfortunately it's a bit more complicated than regular plot 'stuff'. I found gnuplot easier for stacked bars, but than as said my experience with matplotlib is basic Cheers On Wed, Sep 28, 2011 at 8:54 AM, Michal <mic...@gm...> wrote: > Hello, > I have found the following histogram example > http://gnuplot.sourceforge.net/demo/histograms.4.png > > which was created with the following gnuplot code: > http://gnuplot.sourceforge.net/demo/histograms.4.gnu > > and with this data set > > http://212.182.0.171/cgi-bin/dwww/usr/share/doc/gnuplot-doc/examples/immigration.dat > > How is it possible to do this with Matplotlib? > > Thank you in advance. > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hello, I have found the following histogram example http://gnuplot.sourceforge.net/demo/histograms.4.png which was created with the following gnuplot code: http://gnuplot.sourceforge.net/demo/histograms.4.gnu and with this data set http://212.182.0.171/cgi-bin/dwww/usr/share/doc/gnuplot-doc/examples/immigration.dat How is it possible to do this with Matplotlib? Thank you in advance.
Please consider: plot([1, 2, 3, 4], label='line 1') twinx() plot([11, 12, 11, 14], label='line 2') legend() will draw only label for 'line 2' plot([1, 2, 3, 4], label='line 1') legend() twinx() plot([11, 12, 11, 14], label='line 2') legend() same result, as it will overwrite label 'line 1' with label 'line 2' How to deal with this, without manually positioning legends and if possible including all annotated plot lines in one legend? Thanks
On 9/27/11 4:57 PM, Isidora wrote: > The attached map shows plotted fill paths whose filling extends only to the U.S. borders. Is there any way I could accomplish something like it using Basemap? > > Thanks Isidora: It's probably possible, but there's no simple recipe. The drawcoastlines method returns a LineCollection which you should be able to use to do what you want. Sorry I can't be more specific, but I don't have time to go into any more depth right now. -Jeff > > ---------- Forwarded Message ---------- > From: "Isidora"<is...@ju...> > To: mat...@li... > Subject: matplotlib - fill open path inside U.S. borders > Date: 2011年9月26日 19:55:49 GMT > > Hi, > I am trying to plot filled paths over a U.S. map. I plot the given paths, but since these are not closed paths, the filling is truncated at a line drawn between last and first point in the path. I want to extend the path to the United States border instead. > > > I am no expert in matplotlib or GIS. Could anyone help me find documentation or blogs discussing this type of issue? I am convinced somebody else has already faced this problem although I have not been able to find any paper, documentation, blog on it. > > Thank you > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
The attached map shows plotted fill paths whose filling extends only to the U.S. borders. Is there any way I could accomplish something like it using Basemap? Thanks ---------- Forwarded Message ---------- From: "Isidora" <is...@ju...> To: mat...@li... Subject: matplotlib - fill open path inside U.S. borders Date: 2011年9月26日 19:55:49 GMT Hi, I am trying to plot filled paths over a U.S. map. I plot the given paths, but since these are not closed paths, the filling is truncated at a line drawn between last and first point in the path. I want to extend the path to the United States border instead. I am no expert in matplotlib or GIS. Could anyone help me find documentation or blogs discussing this type of issue? I am convinced somebody else has already faced this problem although I have not been able to find any paper, documentation, blog on it. Thank you
We have uploaded the first release candidate for matplotlib 1.1.0 for testing. * src and OSX versions for download: https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/ * windows binaries are available here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib * website and docs: http://matplotlib.sourceforge.net/rc/v1.1.0rc1/index.html * what's new: http://matplotlib.sourceforge.net/rc/v1.1.0rc1/users/whats_new.html * commit log: https://github.com/matplotlib/matplotlib/commits/v1.1.x/ * CHANGELOG: https://github.com/matplotlib/matplotlib/blob/v1.1.x/CHANGELOG Please let us know if you find problems. You can file issues at the github site https://github.com/matplotlib/matplotlib/issues Thanks to all the developers who have been working hard on this release. JDH
On Tue, Sep 27, 2011 at 11:55 AM, rajtendulkar <pra...@gm...>wrote: > Dear Forum, I am a completely new user to matplotlib. I want to plot a 3D > wireframe / surface plot with matplotlib. I am trying to understand how to > arrange the data so that I will get the correct plot. After trying a lot and > taking reference from different examples, I wrote a code given in the file > temp.py <http://old.nabble.com/file/p32534574/temp.py>. Can anyone please > tell me, how can I fix it to get a correct wireframe or surface plot? I > don't understand the array Z how it should look like. Thank You, Raj > temp.py <http://old.nabble.com/file/p32534574/temp.py> > I don't think your data is well-formed. The input X, Y, and Z needs to be 2D with the same shape. I am confused by your x and y data, which you then pass into meshgrid. To illustrate, meshgrid does this: for: x = [1, 2, 3, 4, 5] y = [1, 2, 3] then the command: X, Y = numpy.meshgrid(x, y) produces (for X): array([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]) and (for Y): array([[1, 1, 1, 1, 1], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3]]) Your x and y look like they are flattened versions of these. In addition, your z doesn't seem to have enough values to fit the domain. Ben Root
Dear Forum, I am a completely new user to matplotlib. I want to plot a 3D wireframe / surface plot with matplotlib. I am trying to understand how to arrange the data so that I will get the correct plot. After trying a lot and taking reference from different examples, I wrote a code given in the file http://old.nabble.com/file/p32534574/temp.py temp.py . Can anyone please tell me, how can I fix it to get a correct wireframe or surface plot? I don't understand the array Z how it should look like. Thank You, Raj http://old.nabble.com/file/p32534574/temp.py temp.py -- View this message in context: http://old.nabble.com/Plotting-in-3D.-how-to-specify-the-data--tp32534574p32534574.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Paul Ivanov wrote: > > Hi Eric, > > This problem was fixed by 2c924046 (Jim Radford 2011年03月08日 15:07:23 -0800 > 459) > and now reads: > > self.canvas.set_rubberband(int(x0), int(y0), int(x1), int(y1)) > > Please update either that line alone, or checkout the latest > matplotlib sources from GitHub. > > best, > -- > Paul Ivanov > Great! thanks. -- View this message in context: http://old.nabble.com/Error-when-zooming-manually-with-the-mouse-outside-of-the-axes-tp32503759p32531767.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On 09/27/2011 06:21 AM, Dave Hirschfeld wrote: > Michael Droettboom<mdroe@...> writes: > >> I'm not able to reproduce the problem: I get the watermark in both png >> and pdf output. This was with git master. >> >> What version of matplotlib are you using? Can you send (off-list) the >> png and pdf files so I can have a look at your output? >> >> Mike >> >> On 09/21/2011 10:28 AM, Dave Hirschfeld wrote: >>> Is this a bug in the PDF/SVG backends or am I doing something wrong? If the >>> former is there any workaround? >>> >>> The simple testcase below demonstrates the problem whereby the watermark > doesn't >>> show up in the pdf output but does in the png output. >>> > I upgraded my python to 2.7.2, numpy to 1.6.1, scipy to 0.10.0b2 and matplotlib > to 1.1.0 using Christoph Gohlke's binaries but I'm still seeing no watermark in > the PDF image :/ Can you send the PDF file to me (off-list)? It would be helpful to look at the content of the file and see the nature of the failure. Mike -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA
Michael Droettboom <mdroe@...> writes: > > I'm not able to reproduce the problem: I get the watermark in both png > and pdf output. This was with git master. > > What version of matplotlib are you using? Can you send (off-list) the > png and pdf files so I can have a look at your output? > > Mike > > On 09/21/2011 10:28 AM, Dave Hirschfeld wrote: > > Is this a bug in the PDF/SVG backends or am I doing something wrong? If the > > former is there any workaround? > > > > The simple testcase below demonstrates the problem whereby the watermark doesn't > > show up in the pdf output but does in the png output. > > I upgraded my python to 2.7.2, numpy to 1.6.1, scipy to 0.10.0b2 and matplotlib to 1.1.0 using Christoph Gohlke's binaries but I'm still seeing no watermark in the PDF image :/ -Dave
Hi All, I recently upgraded my python packages through Enthought. I have a mac osx 10.6.8 Previous versions: python 2.6, matplotlib 0.99.3 (Enthought 6.2) New versions: python 2.7, matplotlib 1.0.1 (Enthought 7.1) I am using the macosx backend. I have some functions I wrote which analyze data. They previously worked with no error. Now I get a weird error I am not sure how to sort out yet: Python[47092] <Error>: CGContextClosePath: no current point. I believe this is a matplotlib issue as searching for CGContextClosePath returns errors regarding drawing lines. I should add that my scripts still run, and the plots are still drawn, but I get a dump of error messages like this in my output. Any ideas what is going on? Thanks, Andre