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






Showing results of 204

<< < 1 .. 3 4 5 6 7 .. 9 > >> (Page 5 of 9)
From: Goyo <goy...@gm...> - 2013年03月14日 17:54:46
2013年3月14日 Oliver King <oli...@gm...>:
> [...]
> I tried doing as you suggested [don't import Tk directly and change the backend to Agg] but it still crashes with the same TkAqua message.
You must set the desired backend from the very begining and before
importing pylab o pyplot.
Goyo
From: Oliver K. <oli...@gm...> - 2013年03月14日 16:11:02
Hi Ben,
> Are you displaying the plots in the thread, or are you just saving the plots directly? If you are saving them directly, then you can set your backend to be "Agg" and get rid of the Tkinter.Tk() call (and probably should get rid of the import as well). That way, matplotlib won't load up any gui toolkits at all.
I'm saving the plots directly (plt.figure();plt.plot();plt.savefig();plt.close(fig)). I tried doing as you suggested [don't import Tk directly and change the backend to Agg] but it still crashes with the same TkAqua message. I don't explicitly import or use Tk anywhere in my code, so it seems that matplotlib is trying to load it anyway even when instructed to use a different backend.
I'm running Enthought Python 7.3-2 on Mac OS X 10.6.8. Note that this problem seems to be restricted to this particular operating system; when I run the code on CentOS, also using EPD 7.3-2, it does not crash.
Cheers,
Oliver
From: <Pau...@me...> - 2013年03月14日 16:05:28
> You lost me. Are you trying to create box and whisker plots or do
> you just want rectangles? N = 2 is awfully small dataset for box/
> whisker plots. If all you want are the rectangles -- use those directly:
>
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.patches import Rectangle
>
> data = np.array([[0.27,0.43],[0.17,0.35]])
> fig, ax = plt.subplots()
> box_width = 0.5
> for pos, row in enumerate(data):
>   xy = (pos+1, np.min(row))
>   box_height = np.max(row) - np.min(row)
>   box = Rectangle(xy, box_width, box_height, facecolor='white',
> edgecolor='black', linewidth=1.5)
>   ax.add_patch(box)
>
> ax.set_xlim([0, pos+2])
> ax.set_ylim([0, data.max()*1.25])
> plt.show()
Dear Paul,
sorry for misleading you!
Indeed, I'm more interested in a rectangle, exactly as you showed it!
Your code and quick response is highly appreciated!
Cheers,
Paul
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended recipient,
you must not copy this message or attachment or disclose the contents to
any other person. If you have received this transmission in error, please
notify the sender immediately and delete the message and any attachment
from your system. Merck KGaA, Darmstadt, Germany and any of its
subsidiaries do not accept liability for any omissions or errors in this
message which may arise as a result of E-Mail-transmission or for damages
resulting from any unauthorized changes of the content of this message and
any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its
subsidiaries do not guarantee that this message is free of viruses and does
not accept liability for any damages caused by any virus transmitted
therewith.
Click http://www.merckgroup.com/disclaimer to access the German, French,
Spanish and Portuguese versions of this disclaimer.
From: Paul H. <pmh...@gm...> - 2013年03月14日 15:52:37
On Thu, Mar 14, 2013 at 12:40 AM, <Pau...@me...> wrote:
> Dear Matplotlibbers,
>
> I'm running matplotlib 1.1.0 and would like to plot pairs of values,
> e.g.
> [[0.27,0.43],[0.17,0.35]]
>
> When using boxplot, the values of the pairs correspond to the "outer
> whiskers", but I would like that the interquartile ranges correspond to the
> value pairs. The whiskers shall NOT be shown.
>
> The rationale behind the value pairs: these pairs correspond to confidence
> intervals, and I would like to compare confidence intervals from different
> measurements and thought that matplotlib could help me.
>
>
>
> Cheers & Thanks,
> Paul
>
>
You lost me. Are you trying to create box and whisker plots or do you just
want rectangles? N = 2 is awfully small dataset for box/whisker plots. If
all you want are the rectangles -- use those directly:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
data = np.array([[0.27,0.43],[0.17,0.35]])
fig, ax = plt.subplots()
box_width = 0.5
for pos, row in enumerate(data):
 xy = (pos+1, np.min(row))
 box_height = np.max(row) - np.min(row)
 box = Rectangle(xy, box_width, box_height, facecolor='white',
edgecolor='black', linewidth=1.5)
 ax.add_patch(box)
ax.set_xlim([0, pos+2])
ax.set_ylim([0, data.max()*1.25])
plt.show()
From: Andrew H. J. <a.h...@gm...> - 2013年03月14日 15:32:23
Dear all, 
None of the obvious ways for changing ticklabels seem to work for the current version of Matplotlib (1.2.0 for me). At present, ax.yaxis.get_ticklabels().get_text() returns empty strings, as does ax.get_yticklabels(), and the equivalent set_* functions don't seem to have any effect. 
So: help! 
Yours, 
Andrew
From: asayeed <as...@mb...> - 2013年03月14日 14:59:04
Hi there, 
It seems a little odd to me that rec2csv would overthrow float formatting,
such as FormatFloat(2). I am reading in a file that looks like (with
csv2rec):
ES2006a C 2_1 if 23.53 23.66 0.13 0.17 -0.7844
-2.2863 IN 4.819 1.981 2.838 if 0 0 
ES2006a C 2_1 it 23.66 23.74 0.08 0.21 -1.3039
-1.7667 PRP 2.802 1.518 1.284 it 0 0 
ES2006a C 2_1 was 23.74 23.9 0.16 0.27 -0.663 
-2.5537 AUX 2.694 0.955 1.739 was 0 0 
ES2006a C 2_1 sent 23.9 24.17 0.27 0.36 -2.62 
-4.062 VBN 6.964 1.317 5.647 sent 1 2 
And I am doing a few numpy things to it, and then spitting the results back
out into a file that ends up looking like this:
ES2006a C 2_1 if 23.530000000000001 23.66 0.13 
0.170000
00000000001 -0.78439999999999999 -2.2863000000000002 IN 
4.819 
1.9810000000000001 2.8380000000000001 if 0 0 0.0
ES2006a C 2_1 it 23.66 23.739999999999998 
0.08000000000000
0002 0.20999999999999999 -1.3039000000000001 -1.7666999999999999 
PRP 2.802 1.518 1.284 it 0 0 0.0
ES2006a C 2_1 was 23.739999999999998 23.899999999999999 
0.16 0.27000000000000002 -0.66300000000000003 -2.5537000000000001 
AUX 2.694 0.95499999999999996 1.7390000000000001 was 0 
0 0.0
ES2006a C 2_1 sent 23.899999999999999 24.170000000000002 
0.27000000000000002 0.35999999999999999 -2.6200000000000001 
-4.0620000000000003 VBN 6.964 1.3169999999999999 
5.6470000000000002 sent 1 2 0.0
which is not at all what I want. I want the numbers to look like the
originally did in the input file...or at least better truncated.
I tried to use FormatFloat(n), but the documentation (plus the mlib code)
says that rec2csv overrides the FormatFloat to get a %r format. 
My stopgap measure is to create my own FormatFloatForce that looks like
this:
class FormatFloatForce(mlab.FormatFormatStr):
 def __init__(self):
 mlab.FormatFormatStr.__init__(self, "%g")
 def toval(self, x):
	return x
 def fromstr(self, s):
 return float(s)
But this seems rather hideous to me, especially since I have to apply it to
every numerical column. Am I simply doing this all wrong?
Yours,
--Asad.
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/rec2csv-forcing-precision-tp40655.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: kevin <kev...@gm...> - 2013年03月14日 14:45:03
I am currently trying to work on a program that will allow the user to
display their dataset in the form of a colormap and through the use of
sliders, it will also allow the user to adjust the threshold of the colormap
and thus update the colormap accordingly. The best to describe this would
be through the use of a picture: 
 [1]: http://i.stack.imgur.com/1T9Qp.png
This image shows how the colorbar should look before (the image on the left)
and after (the image on the right) the adjustment. As the threshold values
of the colrobar are changed, the colormap would be updated accordingly.
Now I am mainly using matplotlib and I found that matplotlib does support
some widgets, such as a slider. However the area I need help in is devising
a piece of code which will update the colorbar and colormap (like the way
shown in the picture above) when the slider is adjusted. I was wondering if
anyone has done this before and might have a piece of code they would be
willing to share and might have pointers as to how this can be achieved.
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-Slider-Widget-and-changing-colorbar-threshold-tp40654.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2013年03月14日 13:17:43
On Wed, Mar 13, 2013 at 9:43 PM, Oliver King <oli...@gm...>wrote:
> Hi,
>
> I have a library which uses matplotlib to produce some plots. This library
> is called by a thread. However, python crashes with this error when it
> tries to plot something:
>
> Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main
> thread!
>
> If I do as it says and call "window = Tkinter.Tk()" in the main thread
> before spawning the thread which calls the plotting routines, it works well
> until the program shuts down. When shutting down, I get a series of these
> messages (8 of them, to be precise):
>
> Exception RuntimeError: RuntimeError('main thread is not in main loop',)
> in <bound method PhotoImage.__del__ of <Tkinter.PhotoImage instance at
> 0x90fe260>> ignored
>
> Googling reveals to me that this is a problem with Tk: it doesn't like
> threading. I tried to force matplotlib to use a different backend with this
> command:
> matplotlib.rcParams['backend'] = something_else
> but it still crashes with the first error.
>
> Has anyone encountered this problem before? How did you overcome it?
>
>
Are you displaying the plots in the thread, or are you just saving the
plots directly? If you are saving them directly, then you can set your
backend to be "Agg" and get rid of the Tkinter.Tk() call (and probably
should get rid of the import as well). That way, matplotlib won't load up
any gui toolkits at all.
Cheers!
Ben Root
From: <Pau...@me...> - 2013年03月14日 07:40:14
Dear Matplotlibbers,
I'm running matplotlib 1.1.0 and would like to plot pairs of values, 
e.g.
[[0.27,0.43],[0.17,0.35]]
When using boxplot, the values of the pairs correspond to the "outer 
whiskers", but I would like that the interquartile ranges correspond to 
the value pairs. The whiskers shall NOT be shown.
The rationale behind the value pairs: these pairs correspond to confidence 
intervals, and I would like to compare confidence intervals from different 
measurements and thought that matplotlib could help me.
Cheers & Thanks,
Paul
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith.
Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer.
From: Joe K. <jof...@gm...> - 2013年03月14日 01:48:29
On Wed, Mar 13, 2013 at 3:22 PM, Jonathan Slavin <js...@cf...>wrote:
> Nevermind on my earlier question on artists and using datacursor. I
> figured that one out. What I did was basically (after creating the
> image and contours):
>
> artist = gca().images
> datacursor(artist)
>
> and it worked!
>
Glad it worked! For what it's worth, you can also do:
im = imshow(yourdata)
datacursor(im)
It's a bit cleaner than getting the AxesImage through ax.images.
Cheers!
-Joe
> Jon
>
> On Wed, 2013年03月13日 at 15:50 -0400, Jonathan Slavin wrote:
> > Joe,
> >
> > Thank you! I will especially use it to get the z value in images. I
> > started to try to do something like this once but never finished.
> >
> > One thing I'm having a bit of trouble with is providing an artist as an
> > argument. The reason I wanted to do that is to look only at the values
> > for the image and not those for the contours drawn on the image. How
> > does that work exactly?
> >
> > As a side note, I thought that I had found a bug because an I was
> > looking at image would, in some places, print only the x and y values
> > but not the z value. Then I realized it was printing the values for a
> > contour that I had made invisible by setting its edgecolor to 'None'.
> > This was because the contour created had two parts and I only wanted to
> > show one of them. Anyone know a different way to do that?
> >
> > Regards,
> > Jon
> >
> > On Tue, 2013年03月12日 at 22:58 -0500, Joe Kington wrote:
> > > I recently got around to polishing up a snippet I've been using for
> > > quite awhile. https://github.com/joferkington/mpldatacursor/ and I
> > > was hoping to get some feeding on the current implementation.
> > >
> > >
> > > "mpldatacursor" allows a user to easily click on an artist and display
> > > a customizable, interactive pop-up box displaying information about
> > > the selected artist (e.g. x & y, label, z for images and collections,
> > > etc). It's a stand-alone module (and in pypi), but you could also
> > > just download the examples directory from github and copy the
> > > mpldatacursor.py file into it to try things out.
> > >
> > >
> > > A few key questions:
> > >
> > > 1. Is this something that anyone else finds useful?
> > >
> > > 2. Does it seem intuitive?
> > >
> > > 3. Does the implementation seem flexible enough for most needs?
> > > (Note that any additional kwargs are passed on to annotate to
> > > create the "data cursor", so the appearance of the box is
> > > customizable through annotation kwargs.)
> > >
> > > 4. Are there any obvious features missing?
> > >
> > > 5. Any suggestions? (especially better name suggestions...)
> > >
> > > If it is something that other people find useful, I'd be happy to
> > > submit a pull request to incorporate it into matplotlib. (If I did,
> > > it would probably be best to drop the HighlightDataCursor class, as
> > > its limited in what it can do.)
> > >
> > > Thanks a bunch!
> > >
> > > -Joe
> > >
> > >
> > >
> >
>
> --
> ______________________________________________________________
> Jonathan D. Slavin Harvard-Smithsonian CfA
> js...@cf... 60 Garden Street, MS 83
> phone: (617) 496-7981 Cambridge, MA 02138-1516
> cell: (781) 363-0035 USA
> ______________________________________________________________
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Oliver K. <oli...@gm...> - 2013年03月14日 01:43:25
Hi,
I have a library which uses matplotlib to produce some plots. This library is called by a thread. However, python crashes with this error when it tries to plot something:
Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main thread!
If I do as it says and call "window = Tkinter.Tk()" in the main thread before spawning the thread which calls the plotting routines, it works well until the program shuts down. When shutting down, I get a series of these messages (8 of them, to be precise):
Exception RuntimeError: RuntimeError('main thread is not in main loop',) in <bound method PhotoImage.__del__ of <Tkinter.PhotoImage instance at 0x90fe260>> ignored
Googling reveals to me that this is a problem with Tk: it doesn't like threading. I tried to force matplotlib to use a different backend with this command:
matplotlib.rcParams['backend'] = something_else
but it still crashes with the first error.
Has anyone encountered this problem before? How did you overcome it?
Cheers,
Oliver
From: Jonathan S. <js...@cf...> - 2013年03月13日 20:33:18
Joe,
Thank you! I will especially use it to get the z value in images. I
started to try to do something like this once but never finished.
One thing I'm having a bit of trouble with is providing an artist as an
argument. The reason I wanted to do that is to look only at the values
for the image and not those for the contours drawn on the image. How
does that work exactly?
As a side note, I thought that I had found a bug because an I was
looking at image would, in some places, print only the x and y values
but not the z value. Then I realized it was printing the values for a
contour that I had made invisible by setting its edgecolor to 'None'.
This was because the contour created had two parts and I only wanted to
show one of them. Anyone know a different way to do that?
Regards,
Jon
On Tue, 2013年03月12日 at 22:58 -0500, Joe Kington wrote:
> I recently got around to polishing up a snippet I've been using for
> quite awhile. https://github.com/joferkington/mpldatacursor/ and I
> was hoping to get some feeding on the current implementation.
> 
> 
> "mpldatacursor" allows a user to easily click on an artist and display
> a customizable, interactive pop-up box displaying information about
> the selected artist (e.g. x & y, label, z for images and collections,
> etc). It's a stand-alone module (and in pypi), but you could also
> just download the examples directory from github and copy the
> mpldatacursor.py file into it to try things out.
> 
> 
> A few key questions:
> 
> 1. Is this something that anyone else finds useful? 
> 
> 2. Does it seem intuitive?
> 
> 3. Does the implementation seem flexible enough for most needs?
> (Note that any additional kwargs are passed on to annotate to
> create the "data cursor", so the appearance of the box is
> customizable through annotation kwargs.)
> 
> 4. Are there any obvious features missing?
> 
> 5. Any suggestions? (especially better name suggestions...)
> 
> If it is something that other people find useful, I'd be happy to
> submit a pull request to incorporate it into matplotlib. (If I did,
> it would probably be best to drop the HighlightDataCursor class, as
> its limited in what it can do.)
> 
> Thanks a bunch!
> 
> -Joe
> 
> 
> 
-- 
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
 cell: (781) 363-0035 USA
______________________________________________________________
From: Jonathan S. <js...@cf...> - 2013年03月13日 20:22:45
Nevermind on my earlier question on artists and using datacursor. I
figured that one out. What I did was basically (after creating the
image and contours):
artist = gca().images
datacursor(artist)
and it worked!
Jon
On Wed, 2013年03月13日 at 15:50 -0400, Jonathan Slavin wrote:
> Joe,
> 
> Thank you! I will especially use it to get the z value in images. I
> started to try to do something like this once but never finished.
> 
> One thing I'm having a bit of trouble with is providing an artist as an
> argument. The reason I wanted to do that is to look only at the values
> for the image and not those for the contours drawn on the image. How
> does that work exactly?
> 
> As a side note, I thought that I had found a bug because an I was
> looking at image would, in some places, print only the x and y values
> but not the z value. Then I realized it was printing the values for a
> contour that I had made invisible by setting its edgecolor to 'None'.
> This was because the contour created had two parts and I only wanted to
> show one of them. Anyone know a different way to do that?
> 
> Regards,
> Jon
> 
> On Tue, 2013年03月12日 at 22:58 -0500, Joe Kington wrote:
> > I recently got around to polishing up a snippet I've been using for
> > quite awhile. https://github.com/joferkington/mpldatacursor/ and I
> > was hoping to get some feeding on the current implementation.
> > 
> > 
> > "mpldatacursor" allows a user to easily click on an artist and display
> > a customizable, interactive pop-up box displaying information about
> > the selected artist (e.g. x & y, label, z for images and collections,
> > etc). It's a stand-alone module (and in pypi), but you could also
> > just download the examples directory from github and copy the
> > mpldatacursor.py file into it to try things out.
> > 
> > 
> > A few key questions:
> > 
> > 1. Is this something that anyone else finds useful? 
> > 
> > 2. Does it seem intuitive?
> > 
> > 3. Does the implementation seem flexible enough for most needs?
> > (Note that any additional kwargs are passed on to annotate to
> > create the "data cursor", so the appearance of the box is
> > customizable through annotation kwargs.)
> > 
> > 4. Are there any obvious features missing?
> > 
> > 5. Any suggestions? (especially better name suggestions...)
> > 
> > If it is something that other people find useful, I'd be happy to
> > submit a pull request to incorporate it into matplotlib. (If I did,
> > it would probably be best to drop the HighlightDataCursor class, as
> > its limited in what it can do.)
> > 
> > Thanks a bunch!
> > 
> > -Joe
> > 
> > 
> > 
> 
-- 
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
 cell: (781) 363-0035 USA
______________________________________________________________
From: Chao Y. <cha...@gm...> - 2013年03月13日 18:45:25
Dear Goyo,
Thanks for your information. I finally change them into pdf but not used
yet.
Otherwise I will try png format.
cheers,
Chao
On Wed, Mar 13, 2013 at 6:54 PM, Goyo <goy...@gm...> wrote:
> 2013年3月11日 Chao YUE <cha...@gm...>:
> > Dear all,
> >
> > I searched the internet but still get confused by how can I save a figure
> > with high dpi value to jpeg format.
> >
> > I am using matplotlib 1.2.0 with ubuntu system.
> > In [14]: mat.__version__
> > Out[14]: '1.2.0'
> >
> > I tried both setting the flag "savefig.dpi" flag in matplotlibrc as 300,
> > and use fig.savefig('temp.jpg',dpi=300) when saving the figure.
> > But when I checked the figure dpi with GIMP, it says 72.
>
> I can replicate this, but saving as png I get the correct dpi. I don't
> know if this is a bug or a limitation of the jpg format.
>
> Anyway, the jpg and png images are made of the same number of pixels
> hence the dpi should not be an issue provided you can scale the image
> in your publishing software. And the png format will do better in many
> cases.
>
> Goyo
>
-- 
***********************************************************************************
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
************************************************************************************
2013年3月11日 Chao YUE <cha...@gm...>:
> Dear all,
>
> I searched the internet but still get confused by how can I save a figure
> with high dpi value to jpeg format.
>
> I am using matplotlib 1.2.0 with ubuntu system.
> In [14]: mat.__version__
> Out[14]: '1.2.0'
>
> I tried both setting the flag "savefig.dpi" flag in matplotlibrc as 300,
> and use fig.savefig('temp.jpg',dpi=300) when saving the figure.
> But when I checked the figure dpi with GIMP, it says 72.
I can replicate this, but saving as png I get the correct dpi. I don't
know if this is a bug or a limitation of the jpg format.
Anyway, the jpg and png images are made of the same number of pixels
hence the dpi should not be an issue provided you can scale the image
in your publishing software. And the png format will do better in many
cases.
Goyo
From: Andrew J. <a.h...@gm...> - 2013年03月13日 16:52:08
Dear all,
None of the obvious ways for changing ticklabels seem to work for the 
current version of Matplotlib (1.2.0 for me). At present, 
ax.yaxis.get_ticklabels().get_text() returns empty strings, as does 
ax.get_yticklabels(), and the equivalent set_* functions don't seem to 
have any effect.
So: help!
Yours,
Andrew
On Tue, Mar 12, 2013 at 11:58 PM, Joe Kington <jof...@gm...> wrote:
> I recently got around to polishing up a snippet I've been using for quite
> awhile. https://github.com/joferkington/mpldatacursor/ and I was hoping to
> get some feeding on the current implementation.
>
> "mpldatacursor" allows a user to easily click on an artist and display a
> customizable, interactive pop-up box displaying information about the
> selected artist (e.g. x & y, label, z for images and collections, etc).
> It's a stand-alone module (and in pypi), but you could also just download
> the examples directory from github and copy the mpldatacursor.py file into
> it to try things out.
>
> A few key questions:
>
> Is this something that anyone else finds useful?
Yes, I had tried out your previous snippet.
I thought it would make a nice way to get the labels for an outlier
plot, when there are too many points to add the labels to the plot.
(statsmodels didn't have an outlier plot or calculations at the time.)
Thanks for the snippets.
Josef
>
> Does it seem intuitive?
>
> Does the implementation seem flexible enough for most needs? (Note that any
> additional kwargs are passed on to annotate to create the "data cursor", so
> the appearance of the box is customizable through annotation kwargs.)
>
> Are there any obvious features missing?
>
> Any suggestions? (especially better name suggestions...)
>
> If it is something that other people find useful, I'd be happy to submit a
> pull request to incorporate it into matplotlib. (If I did, it would
> probably be best to drop the HighlightDataCursor class, as its limited in
> what it can do.)
>
> Thanks a bunch!
>
> -Joe
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Phil E. <pel...@gm...> - 2013年03月13日 10:08:44
Thanks for this Joe, mpldatacursor looks like an excellent piece of work -
I for one will be installing and using it regularly.
Thanks for sharing!
On 13 March 2013 03:58, Joe Kington <jof...@gm...> wrote:
> I recently got around to polishing up a snippet I've been using for quite
> awhile. https://github.com/joferkington/mpldatacursor/ and I was hoping
> to get some feeding on the current implementation.
>
> "mpldatacursor" allows a user to easily click on an artist and display a
> customizable, interactive pop-up box displaying information about the
> selected artist (e.g. x & y, label, z for images and collections, etc).
> It's a stand-alone module (and in pypi), but you could also just download
> the examples directory from github and copy the mpldatacursor.py file into
> it to try things out.
>
> A few key questions:
>
> 1. Is this something that anyone else finds useful?
>
> 2. Does it seem intuitive?
>
> 3. Does the implementation seem flexible enough for most needs? (Note
> that any additional kwargs are passed on to annotate to create the "data
> cursor", so the appearance of the box is customizable through annotation
> kwargs.)
>
> 4. Are there any obvious features missing?
>
> 5. Any suggestions? (especially better name suggestions...)
>
> If it is something that other people find useful, I'd be happy to submit a
> pull request to incorporate it into matplotlib. (If I did, it would
> probably be best to drop the HighlightDataCursor class, as its limited in
> what it can do.)
>
> Thanks a bunch!
>
> -Joe
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Joe K. <jof...@gm...> - 2013年03月13日 03:58:11
I recently got around to polishing up a snippet I've been using for quite
awhile. https://github.com/joferkington/mpldatacursor/ and I was hoping
to get some feeding on the current implementation.
"mpldatacursor" allows a user to easily click on an artist and display a
customizable, interactive pop-up box displaying information about the
selected artist (e.g. x & y, label, z for images and collections, etc).
It's a stand-alone module (and in pypi), but you could also just download
the examples directory from github and copy the mpldatacursor.py file into
it to try things out.
A few key questions:
 1. Is this something that anyone else finds useful?
 2. Does it seem intuitive?
 3. Does the implementation seem flexible enough for most needs? (Note
 that any additional kwargs are passed on to annotate to create the "data
 cursor", so the appearance of the box is customizable through annotation
 kwargs.)
 4. Are there any obvious features missing?
 5. Any suggestions? (especially better name suggestions...)
If it is something that other people find useful, I'd be happy to submit a
pull request to incorporate it into matplotlib. (If I did, it would
probably be best to drop the HighlightDataCursor class, as its limited in
what it can do.)
Thanks a bunch!
-Joe
From: Andrew D. <da...@at...> - 2013年03月12日 18:00:37
I tried this and although it sort-of works, it doesn't really do what I
need. I tried using this:
import matplotlib.pyplot as plt
import matplotlib.path as mpath
import numpy as np
import copy
# create figure and axes
fig = plt.figure(figsize=(6, 6))
ax = fig.add_axes([.1, .1, .8, .8])
ax.set_xlim([-3, 3])
ax.set_ylim([-3, 3])
# a circle at the origin with radius 1
circle = plt.Circle((0, 0), 1, transform=ax.transData,
 edgecolor='k', facecolor='none')
# from Phil's example
exterior = mpath.Path.unit_rectangle()
interior = circle.get_path()
exterior = mpath.Path(copy.deepcopy(exterior.vertices),
 copy.deepcopy(exterior.codes[:]))
interior.vertices = interior.vertices[::-1]
exterior.vertices *= 6
exterior.vertices -= 3
clip_path = mpath.Path(vertices=np.concatenate([exterior.vertices,
interior.vertices]),
 codes=np.concatenate([exterior.codes,
interior.codes]))
# lines from the origin dividing the axes into 8 sectors
end_coords = [(3, 0), (3, 3), (0, 3), (-3, 3),
 (-3, 0), (-3, -3), (0, -3), (3, -3)]
for x, y in end_coords:
 line, = ax.plot((x, 0), (y, 0), color='k')
 line.set_clip_path(clip_path, ax.transData)
ax.add_artist(circle)
plt.show()
and the result is the attached image with_clipping.png. You should see that
the circle is no longer circular, and also there are weird line width
issues. What I want it basically exactly like the attached
without_clipping.png but with paths inside the circle removed.
Thanks
On 12 March 2013 16:43, Phil Elson <pel...@gm...> wrote:
> You could just use paths which have holes in them, making the exterior so
> broad that you wouldn't notice the edge of the clipping. I've put together
> an example of doing just that:
>
> import matplotlib.pyplot as plt
> import matplotlib.path as mpath
> import matplotlib.collections as mcol
> import numpy as np
> import copy
>
>
> exterior = mpath.Path.unit_rectangle()
> exterior = mpath.Path(copy.deepcopy(exterior.vertices),
> copy.deepcopy(exterior.codes[:]))
> exterior.vertices *= 4
> exterior.vertices -= 2
> interior = mpath.Path.unit_circle()
> interior.vertices = interior.vertices[::-1]
> clip_path = mpath.Path(vertices=np.concatenate([exterior.vertices,
> interior.vertices]),
> codes=np.concatenate([exterior.codes,
> interior.codes]))
>
> star = mpath.Path.unit_regular_star(6)
> star.vertices *= 2.6
>
>
> ax = plt.subplot(321)
> col = mcol.PathCollection([clip_path], facecolor='yellow')
> ax.add_collection(col)
> ax.set_title('Clip path')
> ax.set_xlim([-3, 3])
> ax.set_ylim([-3, 3])
>
>
> ax = plt.subplot(322)
> col = mcol.PathCollection([star], facecolor='red')
> ax.add_collection(col)
> ax.set_title('Target polygon')
> ax.set_xlim([-3, 3])
> ax.set_ylim([-3, 3])
>
>
> ax = plt.subplot2grid((3, 2), (1, 0), colspan=2, rowspan=2)
> col = mcol.PathCollection([star])
> col.set_clip_path(clip_path, ax.transData)
> ax.add_collection(col)
>
> ax.set_title('Target polygon clipped by clip_path')
> ax.set_xlim([-3, 3])
> ax.set_ylim([-3, 3])
>
> plt.tight_layout()
>
> plt.show()
>
> [image: Inline images 1]
>
>
>
> There are other options if this doesn't cut the mustard.
>
> HTH,
>
>
>
>
>
>
>
> On 12 March 2013 15:37, Andrew Dawson <da...@at...> wrote:
>
>> Hi
>>
>> I'd like to be able to clip a line so that the portion of it lying
>> outside of a given polygon remains visible and the part that lies inside of
>> the polygon is not visible. What I want is basically the opposite of:
>>
>> line.set_clip_path(polygon)
>>
>> which leaves only the part of the line inside the polygon visible. Is
>> this possible?
>>
>> I know I can just fill the polygon with the background color or something
>> but this gets messy when there are other lines on the plot that don't need
>> to be clipped.
>>
>> Thanks,
>> Andrew
>>
>>
>> ------------------------------------------------------------------------------
>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>> endpoint security space. For insight on selecting the right partner to
>> tackle endpoint security challenges, access the full report.
>> http://p.sf.net/sfu/symantec-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
-- 
Dr Andrew Dawson
Atmospheric, Oceanic & Planetary Physics
Clarendon Laboratory
Parks Road
Oxford OX1 3PU, UK
Tel: +44 (0)1865 282438
Email: da...@at...
Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson
From: Benjamin R. <ben...@ou...> - 2013年03月12日 17:20:55
On Tue, Mar 12, 2013 at 12:12 PM, Thomas Lecocq <thl...@ms...> wrote:
> Dear all,
>
> I've successfully forked matplotlib.basemap to ThomasLecocq.basemap and
> cloned ThomasLecocq.basemap to my machine. Now, how can I have this clone
> be THE mpl_toolkits.basemap package, so I can make edits in the __init__.py
> (that contains the Basemap class) and preview them "live" on this machine.
> Once they are nice and OK, I can commit/push it to my master on github and
> probably create a pull request to the matplotlib.basemap git ?
>
> Thanks a lot in advance,
>
> Thom
>
>
You would build and install basemap from the git source as you would
normally from a tarball source. Make modifications to the source, do a
"python setup.py install", test, and repeat as needed. When happy, commit
those changes to your local branch, push that branch up to your github
account, and then from github make a PR.
The instructions for basemap wouldn't be all that different from
matplotlib, which can be found here:
http://matplotlib.org/devel/gitwash/index.html
Cheers!
Ben Root
From: Phil E. <pel...@gm...> - 2013年03月12日 16:43:27
Attachments: clipped.png
You could just use paths which have holes in them, making the exterior so
broad that you wouldn't notice the edge of the clipping. I've put together
an example of doing just that:
import matplotlib.pyplot as plt
import matplotlib.path as mpath
import matplotlib.collections as mcol
import numpy as np
import copy
exterior = mpath.Path.unit_rectangle()
exterior = mpath.Path(copy.deepcopy(exterior.vertices),
 copy.deepcopy(exterior.codes[:]))
exterior.vertices *= 4
exterior.vertices -= 2
interior = mpath.Path.unit_circle()
interior.vertices = interior.vertices[::-1]
clip_path = mpath.Path(vertices=np.concatenate([exterior.vertices,
interior.vertices]),
 codes=np.concatenate([exterior.codes,
interior.codes]))
star = mpath.Path.unit_regular_star(6)
star.vertices *= 2.6
ax = plt.subplot(321)
col = mcol.PathCollection([clip_path], facecolor='yellow')
ax.add_collection(col)
ax.set_title('Clip path')
ax.set_xlim([-3, 3])
ax.set_ylim([-3, 3])
ax = plt.subplot(322)
col = mcol.PathCollection([star], facecolor='red')
ax.add_collection(col)
ax.set_title('Target polygon')
ax.set_xlim([-3, 3])
ax.set_ylim([-3, 3])
ax = plt.subplot2grid((3, 2), (1, 0), colspan=2, rowspan=2)
col = mcol.PathCollection([star])
col.set_clip_path(clip_path, ax.transData)
ax.add_collection(col)
ax.set_title('Target polygon clipped by clip_path')
ax.set_xlim([-3, 3])
ax.set_ylim([-3, 3])
plt.tight_layout()
plt.show()
[image: Inline images 1]
There are other options if this doesn't cut the mustard.
HTH,
On 12 March 2013 15:37, Andrew Dawson <da...@at...> wrote:
> Hi
>
> I'd like to be able to clip a line so that the portion of it lying outside
> of a given polygon remains visible and the part that lies inside of the
> polygon is not visible. What I want is basically the opposite of:
>
> line.set_clip_path(polygon)
>
> which leaves only the part of the line inside the polygon visible. Is this
> possible?
>
> I know I can just fill the polygon with the background color or something
> but this gets messy when there are other lines on the plot that don't need
> to be clipped.
>
> Thanks,
> Andrew
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Andrew D. <da...@at...> - 2013年03月12日 16:13:51
Hi
I'd like to be able to clip a line so that the portion of it lying outside
of a given polygon remains visible and the part that lies inside of the
polygon is not visible. What I want is basically the opposite of:
 line.set_clip_path(polygon)
which leaves only the part of the line inside the polygon visible. Is this
possible?
I know I can just fill the polygon with the background color or something
but this gets messy when there are other lines on the plot that don't need
to be clipped.
Thanks,
Andrew
From: Thomas L. <thl...@ms...> - 2013年03月12日 16:12:30
Dear all,
I've successfully forked matplotlib.basemap to 
ThomasLecocq.basemap and cloned ThomasLecocq.basemap to my machine. Now,
 how can I have this clone be THE mpl_toolkits.basemap package, so I can
 make edits in the __init__.py (that contains the Basemap class) and 
preview them "live" on this machine. Once they are nice and OK, I can 
commit/push it to my master on github and probably create a pull request
 to the matplotlib.basemap git ?
Thanks a lot in advance,
Thom
ps : if this mail goes through and the previous didn't, might be becaused I did not use the forked term in the subject...
**********************
Dr Thomas Lecocq 
Geologist
Royal Observatory of Belgium
- Seismology -
**********************
 		 	 		 
From: Thomas L. <thl...@ms...> - 2013年03月12日 16:08:53
Dear all,
I've successfully forked matplotlib.basemap to ThomasLecocq.basemap and cloned ThomasLecocq.basemap to my machine. Now, how can I have this clone be THE mpl_toolkits.basemap package, so I can make edits in the __init__.py (that contains the Basemap class) and preview them "live" on this machine. Once they are nice and OK, I can commit/push it to my master on github and probably create a pull request to the matplotlib.basemap git ?
Thanks a lot in advance,
Thom
**********************
Dr Thomas Lecocq 
Geologist
Royal Observatory of Belgium
- Seismology -
**********************
 		 	 		 

Showing results of 204

<< < 1 .. 3 4 5 6 7 .. 9 > >> (Page 5 of 9)
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 によって変換されたページ (->オリジナル) /