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





Showing 4 results of 4

From: Joel B. M. <jo...@ki...> - 2014年06月20日 16:44:48
I have observed that the amount of time to draw a figure with a plot
depends heavily on the number of tick marks on the axes. This appears
to be a major driver of perceived refresh performance on interactive
graphics in PySide (for example). Somewhat tangentially this makes
log axes appear to perform slowly, but I think that is merely a
side-effect of the fact that log axes come with minor tick marks by
default. I'm working with built-from-source matplotlib as of Apr 17,
2014; I think the observations here apply to any recent matplotlib.
I've published a full illustration at
https://gist.github.com/jbmohler/7c5c8cca39826ea8ede7 . This small
PySide application lets you enter the number of points in a scatter
plot and the number of minor tick marks. You can see for yourself
that increasing the number of points in the scatter plot has little
impact on performance, but increasing the number of tick marks has a
noticeable effect with only moderate increase.
Why does this matter if you have a sane number of tick marks? It
points to tick marks being simply very expensive -- on my 2 year old
quad core, entirely removing tick marks results in 117 frames per
second, but with 7 (major) tick marks on x & y that drops to 38 frames
per second. I think 100 tick marks falls with-in "sane" (in some
cases) and a graph with 100 tick marks has decidedly more lag in a gui
than 10 tick marks. As mentioned above, log axes are particularly
likely place to have lots of tick marks.
How can I fix this? I'm not sure, but I think there are reasonable
special cases that could be highly optimized. The problem seems to me
to be that each tick mark is a Line2D artist and that has a marker
type (in fact, I think there is no "line" shown, the tick mark is the
single marker of the Line2D). In the case of uniform sized tick
marks, I believe the tick marks for an axis could be all in one Line2D
with each tick mark being a marker in the single Line2D. This is a
huge reduction of artists which seems likely to yield a speed up in
quite few places.
I'd love to hear your thoughts and/or fix suggestions on this topic.
Joel
From: Bruno P. <bru...@gm...> - 2014年06月20日 15:15:08
Ok! I'm getting there! I've been trying to figure out, though, how to set
black - for example - for the zero values BUT interpolate also the colors
linearly from black to blue in the linear region (from zero to the linear
threshold). Is there a way to change the colormap like that?
Thanks a lot!
On 2014年06月18日, 5:23 AM, Bruno Pace wrote:
> Ok, so using the norm=SymLogNorm I cannot distinguish the values that
> are exactly 0.0 from the really small ones, right? Would it be possible
>
Correct, the scale is linear for small values.
 to make use of the set_bad method without having to use masked arrays,
> just combining the SymLogNorm and the set_bad?
>
No, the mask is what identifies a point as bad. If you want to distinguish
zero from non-zero, no matter how small, then this is the way to do it.
zm = np.ma.masked_equal(z, 0, copy=False)
Now you have a masked array where the points that are exactly zero are
masked.
The bad color won't show up on the colorbar, however. There is no suitable
place for it. It can show only the range from vmin to vmax, and a
"set_over" color for values greater than vmax, and a "set_under" color for
values less than vmin.
Eric
From: Chris B. <bea...@ha...> - 2014年06月20日 13:42:17
Hey Tom,
It looks like the only backend-agnostic file save function is save_figure()
(a toolbar method), which conflates choosing a filename and doing the
actual saving. The backend-specific code to choose a filename via a dialog
isn't uniform:
Qt4:
matplotlib.backends.backend_qt4._getSaveFileName
MacOS
matplotlib.backends.backend_osx._macosx.choose_save_file
Wx:
A bunch of code in matplotlib.backends.backend_wx.save_figure
TkAgg:
Tkinter.FileDialog
GtkAgg:
get_filechooser().get_filename_from_user()
It looks like, at a minimum, you would have to write your own wrapper code
to make a backend-agnostic interface for choosing a filename. Of course, if
you did that, it would also be nice to refactor that into MPL itself... :)
chris
On Fri, Jun 20, 2014 at 8:22 AM, Thomas Robitaille <
tho...@gm...> wrote:
> Hi everyone,
>
> I'm developing a simple GUI tool in Matplotlib that relies on the
> event framework to handle buttons/sliders. I am trying to avoid using
> a GUI toolkit directly to ensure maximum compatibility for users.
>
> One thing I would like is to be able to have a 'save' button that will
> open up a standard 'save file' dialog window (but not necessarily the
> plot itself). Matplotlib already has 'save file' GUI dialogs for the
> different backends, so I was wondering whether there is an easy and
> abstract way of asking matplotlib to open a 'save file' dialog and
> capturing the output? Or is this all handled separately in the
> different backends?
>
> Thanks!
> Tom
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> --
> *************************************
> Chris Beaumont
> Senior Software Engineer
> Harvard Center for Astrophysics
> 60 Garden Street, MS 42
> Cambridge, MA 02138
> chrisbeaumont.org
> *************************************
>
From: Thomas R. <tho...@gm...> - 2014年06月20日 12:23:06
Hi everyone,
I'm developing a simple GUI tool in Matplotlib that relies on the
event framework to handle buttons/sliders. I am trying to avoid using
a GUI toolkit directly to ensure maximum compatibility for users.
One thing I would like is to be able to have a 'save' button that will
open up a standard 'save file' dialog window (but not necessarily the
plot itself). Matplotlib already has 'save file' GUI dialogs for the
different backends, so I was wondering whether there is an easy and
abstract way of asking matplotlib to open a 'save file' dialog and
capturing the output? Or is this all handled separately in the
different backends?
Thanks!
Tom

Showing 4 results of 4

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