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

Showing 7 results of 7

From: ChaoYue <cha...@gm...> - 2013年05月21日 20:21:18
Hi Mat,
this has been asked before. see here:
http://matplotlib.1069221.n5.nabble.com/quot-zig-zag-quot-to-represent-suppressed-0-on-axis-td40849.html#a40858
cheers,
Chao
On Mon, May 20, 2013 at 8:29 PM, mat [via matplotlib] <
ml-...@n5...> wrote:
> Dear community,
>
> I would like to truncate the x axis of a plot, as in the attached figure:
>
> Is it possible to do so ?
>
> Best,
> Mat
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092.html
> To start a new topic under matplotlib - users, email
> ml-...@n5...
> To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx>
> .
> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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: http://matplotlib.1069221.n5.nabble.com/Is-it-possible-to-truncate-axes-in-matplotlib-tp41092p41103.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: ChaoYue <cha...@gm...> - 2013年05月21日 20:15:46
Dear Martin,
I worked out a similar example for your reference as I don't catch your
example very well.
fig =
plt.figure()
ax1 =
fig.add_subplot(211)
ax2 =
fig.add_subplot(212)
arrlist = [np.random.normal(size=100) for i in
range(50)]
ret =
ax1.hist(arrlist,histtype='barstacked')
reclist = [patchlist[0] for patchlist in
ret[2]]
labellist = ['data'+str(i) for i in
range(50)]
ax2.legend(reclist,labellist,loc='upper
left',bbox_to_anchor=(0,0,1,1),borderaxespad=0.,ncol=5,mode='expand')
ax2.set_frame_on(False)
ax2.tick_params(bottom='off',left='off',right='off',top='off')
plt.setp(ax2.get_yticklabels(),visible=False)
plt.setp(ax2.get_xticklabels(),visible=False)
you're asking some object-oriented way, I personally don't think using
pylab and set_tight_layout are the good way
to be "object-oriented" as pylab is only a bounding wrapper by my
understanding (maybe I am wrong!). legend and
hist are all matplotlib.axes.Axes method.
Also, I think it's unrealistic to ask the figure do a nice job for you if
there are 50 legned handlers and you want to show
them in 2 columns with a very high width/height ratio of the figure....
hope it could be of a bit help,
cheers,
Chao
On Mon, May 20, 2013 at 6:43 PM, Martin Mokrejs [via matplotlib] <
ml-...@n5...> wrote:
> Hi Ben,
>
> Benjamin Root wrote:
>
> >
> >
> >
> > On Mon, May 20, 2013 at 12:02 PM, Martin Mokrejs <[hidden email]<http://user/SendEmail.jtp?type=node&node=41090&i=0><mailto:[hidden
> email] <http://user/SendEmail.jtp?type=node&node=41090&i=1>>> wrote:
> >
> > Hi,
> > I am having trouble to get space allocated for a long legend text,
> > lets say spanning 2/3 - 3/4 of the whole output. I would like to
> have
> > stacked barchart as 1st subplot and the place of remaining 3
> subplots
> > to be actually allocated by the legend. Alternatively, could I get
> the
> > legend saved into a separate figure?
> >
> > Or could the space for legend text be allocated automatically
> minimizing
> > output figure size? For example, the width would be 1120px while
> height
> > be multiples of 840px (840 for each subplot)?
> >
> > Attached is a quick example. It shows also that I tried
> tight_layout()
> > but wasn't successful with this either. I would be glad for some
> help,
> > ideally converting the whole thing into an object-oriented approach.
> > I am generating several figures in a row and would like to
> clear()/del()
> > any previously used data ASAP.
> >
> >
> > Thank you,
> > Martin
> > Am using mpl-1.2.2
> >
> >
> > Try "fig.savefig('foobar.png', bbox_inches='tight')" when saving the
> > image. It will make the figure size such that all the visible
> > elements of the figure will fit into the saved output. tight_layout()
> > is meant to make sure the elements don't overlap each other, but does
> > nothing about making sure nothing gets clipped.
> Ah, would be nice to make this clear in the docs. So far was doing
>
>
> import pylab
> F = pylab.gcf()
> F.set_tight_layout(True)
>
> which as you say does not help the way I thought.
>
>
> Unfortunately, while
>
> fig.savefig('foobar.png', bbox_inches='tight')
>
> helped to get everything into the .png file (attached), the barchart
> itself
> should span according to the code I posted just 1/2 of the figure. But
> somehow
> it is enlarged and rescaled so that it occupies *more than* 1/2 of the
> figure.
> What in pylab is resizing my image? Note: the final image is 625x1075.
>
> Martin
>
> ------------------------------------------------------------------------------
>
> 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
> [hidden email] <http://user/SendEmail.jtp?type=node&node=41090&i=2>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> *foobar.png* (132K) Download Attachment<http://matplotlib.1069221.n5.nabble.com/attachment/41090/0/foobar.png>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://matplotlib.1069221.n5.nabble.com/Making-space-for-a-long-legend-outside-of-a-barchart-tp41088p41090.html
> To start a new topic under matplotlib - users, email
> ml-...@n5...
> To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx>
> .
> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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: http://matplotlib.1069221.n5.nabble.com/Making-space-for-a-long-legend-outside-of-a-barchart-tp41088p41102.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: gaspra <ye...@gm...> - 2013年05月21日 18:02:54
Michael Droettboom-3 wrote
> Michael Droettboom-3 wrote
> The issue I filed was related to the build problem you reported -- that 
> building matplotlib with a MacPorts python is trying to use the system 
> (framework) Tcl/Tk. That's completely independent of the other problem 
> related to ticks, which should not be affected by the backend at all. 
> In my quick skimming of this thread, I thought that that issue was 
> resolved, but apparently not. I'll look into that further and file a 
> separate issue for that if need be.
I have experimented the setupext.py a little bit and find this change can 
compile matplotlib using MacPorts python and Tcl/Tk without conflict:
 def parse_tcl_config(self, tcl_lib_dir, tk_lib_dir):
 ...
 tcl_poss = [tcl_lib_dir,
 os.path.normpath(os.path.join(tcl_lib_dir, '..')),
 "/usr/lib/tcl" + str(Tkinter.TclVersion),
 "/opt/local/lib"] # /usr/lib is replaced by
/opt/local/lib
 tk_poss = [tk_lib_dir,
 os.path.normpath(os.path.join(tk_lib_dir, '..')),
 "/usr/lib/tk" + str(Tkinter.TkVersion),
 "/opt/local/lib"] # /usr/lib is replaced by
/opt/local/lib
 ...
I also replaced this logical statement: 
 elif sys.platform == 'darwin':
by 
 elif sys.platform == 'dummy':
The reason why I replaced /usr/lib with /opt/local/lib instead of expanding
the 
tcl_poss and tk_poss lists is that the system tclConfig.sh and tkConfig.sh
are 
located in /usr/lib, while the MacPorts tclConfig.sh and tkConfig.sh are
located 
in /opt/local/lib.
I don't think we really need specially treatment for Mac OS, since
tclConfig.sh and 
tkConfig.sh will return correctly Tcl/Tk lib/include path. Maybe I am
missing something? 
I have tested this and it works perfectly fine. Surely this assumes the 
MacPorts Tcl/Tk are installed. Conditions need to be added so they can check
wether 
we are using MacPorts Python, wether MacPorts Tcl/Tk exist if using MacPorts
Python. 
If MacPorts Tcl/Tk exist then we use /opt/local/lib, otherwise we use
/usr/lib.
Hope this helps. Thanks.
Yuan
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/missing-ticks-on-inverted-log-axis-tp41063p41100.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: gaspra <ye...@gm...> - 2013年05月21日 17:20:26
Michael Droettboom-3 wrote
> I have opened an issue (with a fix) here:
> 
> https://github.com/matplotlib/matplotlib/pull/2036
Awesome, this solved the problem I encountered. 
Many thanks,
Yuan
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/missing-ticks-on-inverted-log-axis-tp41063p41099.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2013年05月21日 14:22:15
I have opened an issue (with a fix) here:
https://github.com/matplotlib/matplotlib/pull/2036
Gregorio: Could you please confirm that the patch there addresses your 
original problem?
Mike
On 05/21/2013 08:54 AM, Michael Droettboom wrote:
> On 05/20/2013 06:42 PM, gaspra wrote:
>> Michael Droettboom-3 wrote
>>> I have created https://github.com/matplotlib/matplotlib/issues/2025 to
>>> track this.
>> Hi Michael, thanks. I am somewhat convinced the problem is related to
>> matplotlib 1.3.x, not the Tk library. I tried on Linux that uses Tk8.5 and I
>> got the missing ticks for inverted log axes as well. So the TkAgg backend
>> only works properly with matplotlib 1.2.0.
>>
>> I further tested macports python, matplotlib 1.3.x and system Tk 8.5 on Mac.
>> I did so by uninstalling macports version of Tk/Tcl (8.6). The ticks are
>> also missing.
>>
>> Additional test on gtkagg backend shows the same thing: matplotlib 1.2.0
>> works perfectly fine with gtkagg, while matplotlib 1.3.x has the missing
>> ticks.
>>
>> Probably you have a better sense on what is going on?
>>
> The issue I filed was related to the build problem you reported -- that
> building matplotlib with a MacPorts python is trying to use the system
> (framework) Tcl/Tk. That's completely independent of the other problem
> related to ticks, which should not be affected by the backend at all.
> In my quick skimming of this thread, I thought that that issue was
> resolved, but apparently not. I'll look into that further and file a
> separate issue for that if need be.
>
> Mike
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael D. <md...@st...> - 2013年05月21日 12:54:54
On 05/20/2013 06:42 PM, gaspra wrote:
> Michael Droettboom-3 wrote
>> I have created https://github.com/matplotlib/matplotlib/issues/2025 to
>> track this.
> Hi Michael, thanks. I am somewhat convinced the problem is related to
> matplotlib 1.3.x, not the Tk library. I tried on Linux that uses Tk8.5 and I
> got the missing ticks for inverted log axes as well. So the TkAgg backend
> only works properly with matplotlib 1.2.0.
>
> I further tested macports python, matplotlib 1.3.x and system Tk 8.5 on Mac.
> I did so by uninstalling macports version of Tk/Tcl (8.6). The ticks are
> also missing.
>
> Additional test on gtkagg backend shows the same thing: matplotlib 1.2.0
> works perfectly fine with gtkagg, while matplotlib 1.3.x has the missing
> ticks.
>
> Probably you have a better sense on what is going on?
>
The issue I filed was related to the build problem you reported -- that 
building matplotlib with a MacPorts python is trying to use the system 
(framework) Tcl/Tk. That's completely independent of the other problem 
related to ticks, which should not be affected by the backend at all. 
In my quick skimming of this thread, I thought that that issue was 
resolved, but apparently not. I'll look into that further and file a 
separate issue for that if need be.
Mike
From: Gregorio B. <gre...@gm...> - 2013年05月21日 08:47:00
Thanks, I opened an issue for it:
https://github.com/matplotlib/matplotlib/issues/2035
2013年5月17日 Sterling Smith <sm...@fu...>:
> Gregorio,
>
> I'm glad that helped. I have not reported it on the issue tracker, but your case certainly has more of a bug with it (where it works sometimes, but not always), so I would recommend it.
>
> -Sterling
>
> On May 17, 2013, at 2:10AM, Gregorio Bastardo wrote:
>
>> Hi Sterling,
>>
>> Thanks for the hint, using "line._legmarker" attribute solved the problem.
>>
>> I see the reason behind, however I still consider this as an incorrect
>> behaviour, since marker toggling works in case the line is originally
>> added to the legend without marker (so legend line and marker do not
>> behave like separated). Is it worth reporting on the mpl issue tracker
>> (or have you done it that time)?
>>
>> Gregorio
>>
>> 2013年5月16日 Sterling Smith <sm...@fu...>:
>>> Gregorio,
>>>
>>> I experienced a similar issue with trying to change the marker color.
>>>
>>> See below the previous response from JJ for accessing the legend marker or using a proxy artist.
>>>
>>> -Sterling
>>>
>

Showing 7 results of 7

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 によって変換されたページ (->オリジナル) /