SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(6)
2
(3)
3
(4)
4
(1)
5
(19)
6
(8)
7
(3)
8
9
10
(9)
11
(3)
12
(8)
13
(17)
14
(5)
15
(2)
16
(2)
17
(7)
18
(2)
19
(4)
20
(6)
21
22
(5)
23
24
(7)
25
(2)
26
(3)
27
(9)
28
(9)
29
(6)
30
(3)
31
(8)





Showing 6 results of 6

From: Adam H. <hug...@gm...> - 2014年03月20日 17:40:08
Hi,
I am using an IPython notebook style that has a soft, yellow background
that I think is more appealing that white. When I make a plot, I'd like
the background of the plot (ie, everything that is outside the x and y
axis) to be the same color. I'm trying to change the figure.facecolor
parameter through rc params but I don't see any changes. Is
figure.facecolor event he correct parameter?
Has anyone done this successfully?
From: Asma R. <asm...@gm...> - 2014年03月20日 15:34:50
Attachments: 33.5.png 33.png 34.png
Hi,
I am trying to plot a heat map using imshow. My data has 34 rows and 34
columns, so lower limit is 0 and upper is 33, but when I give these limits,
it partially removes some of the cells (see 33.png), when I give the limits
from 0 to 34, there is an extra white space inserted in the heat map which
isn't part of my data(see 34.png), my next try was to set limits from 0 to
33.5 which sort of solves this problem as the previously concealed colors
are now revealed(see 33.5.png), but now I see unqual grid cells on the
boundaries of the map (they are almost half the size of the grids cells
within the map).
My question is if my data has exactly 34 columns and 34 rows, why do I need
an extra 0.5 to do this. Secondly why is that one grid square encompasses
2-3 colors, shouldn't it just be one color per cell of the grid, which is
what I want to see in the map, how can I set the grid lines in such a
manner that one color appears per grid cell- is this because I use imshow?
Here is a snippet of my code:
fig = plt.figure(figsize=(25,25))
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],hspace=0,wspace=0) phyl_ax=plt.subplot(gs[0])
ht_ax=plt.subplot(gs[1])
ht_ax.set_xlim(34,0) ## tried (33.5-0) and (33-0)
ht_ax.set_ylim(34,0) ## tried (33.5-0) and (33-0)
ht_ax.grid(True, which='both')
xticks=range(34)
ht_ax.xaxis.set_ticks(xticks)
ht_ax.yaxis.set_ticks(xticks)
for tick in ht_ax.xaxis.get_major_ticks():
 tick.label1.set_horizontalalignment('right')
img = ht_ax.imshow(data, cmap=cmap,
interpolation='nearest',vmax=threshold,aspect='auto')
phyl_ax.imshow(img,interpolation='bilinear',aspect='auto')
Note that ht_ax is what I use to draw the heat map
Does anyone see where I am going wrong?
Appreciate any help provided in advance!!
--Asma
From: Jesper L. <jes...@gm...> - 2014年03月20日 09:33:31
Hi matplotlib users,
I am currently performing some experiments with plotting in matplotlib for
at web application. One thing I have noticed is that my image test sizes
are reduced by a factor 4.5 when not using antialiasing. And that for
pcolormesh the time it takes to produce a plot without antialiasing is
approximately half the time it takes to produce one with. And for my
application I do not really need antialiasing when the cost is so large.
I was therefore wondering whether it is possible to disable antialiasing
for pcolorfast? Otherwise I guess I will stick with pcolormesh and contourf.
Best regards,
Jesper
From: Chao Y. <cha...@gm...> - 2014年03月20日 09:10:10
Dear Arnaldo,
sorry for the delay in reply. Thanks a lot. This solves my problem well.
Cheers,
Chao
On Sun, Mar 16, 2014 at 7:27 AM, Arnaldo Russo <arn...@gm...>wrote:
> Dear Chao,
>
> You could try this,
>
> import matplotlib
> import matplotlib.pyplot as plt
>
> # create a color bar with:
> sm = plt.cm.ScalarMappable(cmap=plt.get_cmap('Reds'))
> sm.set_array(range(10))
>
> # create an horizontal colorbar and put the ticks on the top.
> # in your case, you could plot colorbar on top, and tick at 'bottom'
> cb = plt.colorbar(sm, orientation='horizontal', location=1.0)
> cb.ax.xaxis.set_ticks_position('top')
> plt.show()
>
> Another way, you could find useful a function written by Ryan May [0]
>
> Hope that fits.
>
> Arnaldo.
>
> [0]
> https://www.mail-archive.com/mat...@li.../msg07447.html
>
>
> ---
> *Arnaldo D'Amaral Pereira Granja Russo*
> Lab. de Estudos dos Oceanos e Clima
> Instituto de Oceanografia - FURG
>
>
>
>
> 2014年03月10日 14:39 GMT-03:00 Chao YUE <cha...@gm...>:
>
>> Dear all,
>>
>> I am using the matplotlib 1.2.0 version, is there some way to put the
>> label above the horizontal colorbar? like in the attached example, I would
>> like the labels to be shown above the colorbar?
>>
>> thanks a lot in advance,
>>
>> Cheers,
>>
>> Chao
>>
>> --
>>
>> ***********************************************************************************
>> 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/13534_NeoTech
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
-- 
***********************************************************************************
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
************************************************************************************
From: Christophe B. <pro...@gm...> - 2014年03月20日 08:46:17
Hello.
Where do I look at so as to build my own patch ? Is it enough to look at,
for example, the class defining rectangles ?
Another question. Let suppose that I want to manage all the drawings, what
will I have to do ? Imagine for example that I want to produce a TiKz code
of a plot.
Best regards.
Christophe BAL
From: Remo G. <su...@li...> - 2014年03月20日 08:27:48
Stupid me! I overlooked parameter 'ax' of class Basemap. You can pass an
axis when creating a Basemap instance:
ax = fig.add_axes([0., 0., 1., 1.])
map = Basemap(...., ax=ax)
Best,
Remo
On 03/19/2014 04:41 PM, Remo Goetschi wrote:
> Dear matplotlib users,
> 
> I'm having trouble using Basemap through the object oriented interface
> of Matplotlib. All the examples on the website use pyplot. But that does
> not work if plots are generated in a parallel environment, i.e., in a
> web application, since pyplot is obviously not thread safe.
> 
> Does anyone have a working example of Basemap without pyplot?
> One of the issues I'm having is that
> 
> coastlines = map.drawcoastlines(linewidth=0.25)
> 
> does not show any coastlines. The underlying figure is created like this:
> 
> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
> from matplotlib.figure import Figure, Axes
> 
> fig = Figure()
> canvas = FigureCanvas(fig)
> ax = Axes(fig, [0., 0., 1., 1.])
> fig.add_axes(ax)
> 
> I feel a bit lost here. Any help is appreciated.
> 
> Cheers,
> Remo
> 
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

Showing 6 results of 6

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /