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

Showing results of 194

1 2 3 .. 8 > >> (Page 1 of 8)
From: Benjamin R. <ben...@ou...> - 2010年12月31日 22:18:18
On Tue, Dec 21, 2010 at 4:28 PM, John Smith <
joh...@bl...> wrote:
> Hi all,
>
> MATLAB has a setting for text called fontunits. Basically if I understand
> it correctly it sets the size of the font relative to the size of the axis
> so that as the graph changes size so does the font. Is there something
> equivalent in Matplotlib?
>
>
>
> John C. Smith
>
Relative to the axis size, not that I am aware of (although you might find
something in mplsizer in mpl_toolkits). You can specify font sizes through
the size parameter:
http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text.set_size
But I think that is it.
Ben Root
From: Benjamin R. <ben...@ou...> - 2010年12月31日 19:43:08
On Sun, Dec 19, 2010 at 3:34 AM, Sylvain Munaut <24...@gm...> wrote:
> Hi,
>
> I was wondering if you ever found a solution to this problem ?
>
> I have the exact same issue with GTK (Agg or cairo) and WX backends
> ... I'm also under gentoo using ipython-0.10.1 and matplotlib-1.0.0
> I don't have the warnings you have but same behavior, I have to call
> show (if I don't a blank 'frozen' window is all that appears) but then
> the ipython doesn't have control anymore.
>
> Cheers,
>
> Sylvain
>
>
It is very possible that this problem was fixed shortly after the 1.0.0
release. Another possibility is that ipython might be causing an issue
where it is loading some older matplotlib codes before the rest of
matplotlib 1.0.0 is loaded (I have seen this happen once).
You can test for this theory by seeing if you have the same problem when
using the regular python shell. If not, then it is likely to be a problem
with ipython. If you do have the same problem in regular python, then the
problem is with matplotlib and you will need to build the latest from svn.
Ben Root
Browsing the web I think I find the solution :)
Hope this helps other users:
The only thing I did is to delete the file:
D:\Documents and Settings\Daniele\.matplotlib\fontList.cache
NB: My windows user is Daniele
Then start the exe and all is plotted correctly!
NB2: everytime I change the name of the "dist" directory I also have to
re-delete the fontList.cache file!
Daniele
ghost82 wrote:
> 
> 
> Werner F. Bruhin wrote:
>> 
>> It should be there, i.e. mpl-data in the lib/site-packages/matplotlib 
>> folder has the same number of files and folders as the one created by 
>> setup.py in dist.
>> 
>> But it obviously doesn't find it or some other setting to handle the 
>> LaTex stuff is not there.
>> 
>> Put this at the top of alphabeta.py, i.e. just after import matplotlib
>> 
>> matplotlib.verbose.level = u'debug'
>> 
>> and change setup.py to generate a console app. If I run this on my dev 
>> machine the output shows that fonts are found, but if I run it on the 
>> py2exe'd version lots of STIX fonts are not found. Even so these fonts 
>> are in mpl-data/fonts/ttf of the py2exe dist folder.
>> 
>> So, I think/guess that the font searching is not done correctly, as 
>> running with verbose "debug" it shows that it finds the mpl-data folder 
>> in the dist folder or wherever you copy dist too.
>> 
>> Hopefully someone who knows how the font searching is done can help 
>> out/point to the culprit.
>> 
> 
> 
> Hi all!
> Any fix for this problem?
> I have the same issue!
> I'm using:
> OS: windows xp sp3
> Python: 2.6.6
> numpy: 1.5.1
> scipy: 0.8.0
> matplotlib: 1.0.0
> Tkinter
> The .py script compiles well to exe program, but the matplotlib fonts
> searching is done in
> D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts (I have insatalled
> python in D:\python26) instead of dist\mpl-data\fonts
> Matplotlib images in \dist\mpl-data\images are loaded correctly.
> In dist\mpl-data\fonts I have same files and folder that are in
> D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts
> So if the folder fonts is in
> D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts the exe program
> runs correctly, but if I delete that folder the program doesn't plot tha
> data and the log shows an error because it doesn't find the Vera font.
> I attach the setup.py http://old.nabble.com/file/p30562579/setup.py
> setup.py 
> 
> Any help is appreciated!
> 
-- 
View this message in context: http://old.nabble.com/py2exe-problems-for-a-tkinter-matpotlib-project---works-for-me%2C-but-%09not-for-others-tp27902210p30562913.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Werner F. Bruhin wrote:
> 
> It should be there, i.e. mpl-data in the lib/site-packages/matplotlib 
> folder has the same number of files and folders as the one created by 
> setup.py in dist.
> 
> But it obviously doesn't find it or some other setting to handle the 
> LaTex stuff is not there.
> 
> Put this at the top of alphabeta.py, i.e. just after import matplotlib
> 
> matplotlib.verbose.level = u'debug'
> 
> and change setup.py to generate a console app. If I run this on my dev 
> machine the output shows that fonts are found, but if I run it on the 
> py2exe'd version lots of STIX fonts are not found. Even so these fonts 
> are in mpl-data/fonts/ttf of the py2exe dist folder.
> 
> So, I think/guess that the font searching is not done correctly, as 
> running with verbose "debug" it shows that it finds the mpl-data folder 
> in the dist folder or wherever you copy dist too.
> 
> Hopefully someone who knows how the font searching is done can help 
> out/point to the culprit.
> 
Hi all!
Any fix for this problem?
I have the same issue!
I'm using:
OS: windows xp sp3
Python: 2.6.6
numpy: 1.5.1
scipy: 0.8.0
matplotlib: 1.0.0
Tkinter
The .py script compiles well to exe program, but the matplotlib fonts
searching is done in D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts
(I have insatalled python in D:\python26) instead of dist\mpl-data\fonts
Matplotlib images in \dist\mpl-data\images are loaded correctly.
In dist\mpl-data\fonts I have same files and folder that are in
D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts
So if the folder fonts is in
D:\Python26\Lib\site-packages\matplotlib\mpl-data\fonts the exe program runs
correctly, but if I delete that folder the program doesn't plot tha data and
the log shows an error because it doesn't find the Vera font.
I attach the setup.py http://old.nabble.com/file/p30562579/setup.py setup.py 
Any help is appreciated!
-- 
View this message in context: http://old.nabble.com/py2exe-problems-for-a-tkinter-matpotlib-project---works-for-me%2C-but-%09not-for-others-tp27902210p30562579.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: andes <czu...@ya...> - 2010年12月30日 03:40:08
JJ,
Your suggestion worked!!!
I stopped using the "round" join style option from matplotlib as you
suggested by writing:
plot(x,y,ls='-',lw=3,solid_joinstyle='bevel')
I did not have to change the rc.
Thanks a bunch!
c
Jae-Joon Lee wrote:
> 
> When I open your eps file with ghostscript, I can see the problem.
> I'm about 95% sure that this is related to the ghostscript not
> correctly rendering the line.
> In your ghostscript viewer, turn off "antialiasing" then you will see
> straight line (of course w/o antialiasing).
> 
> This seems to be a known problem that has recently been fixed
> 
> http://www.ghostscript.com/doc/current/Changes.htm (see the entry of
> 2010年04月07日T13:13:57.741241Z Robin Watts)
> 
> It only happens when you use "round" join style. So, change your rc
> file (or any other setting) not to use "round" style. In case you
> must use "round" style, I guess you'd better upgrade your ghostscript.
> 
> Regards,
> 
> -JJ
> 
> 
> On Mon, Dec 20, 2010 at 8:53 AM, andes <czu...@ya...> wrote:
>>
>> Hello JJ,
>>
>> Thanks so much for replying..
>> I have attached the "eps" file.
>>
>> http://old.nabble.com/file/p30495318/figeps.eps figeps.eps
>>
>> c
>>
>>
>>
>> Jae-Joon Lee wrote:
>>>
>>> Can you post your eps file?
>>> This may be related to the ps rasterizer you're using.
>>> Regards,
>>>
>>> -JJ
>>>
>>>
>>> On Thu, Dec 16, 2010 at 1:46 AM, andes <czu...@ya...> wrote:
>>>>
>>>> hello,
>>>>
>>>> When I save as an "eps" a figure created by matplotlib I face the
>>>> problem
>>>> that the inclined lines in the plot appear to be jagged when I open the
>>>> "eps" (please see figure below). This problem doesn't appear when I
>>>> save
>>>> the
>>>> figure as a pdf or png. Do you you know if there is a simple solution
>>>> to
>>>> this problem that I can implement in my example code (shown below)?
>>>> I would greatly appreciate any advice.
>>>> #----example code
>>>> from numpy import *
>>>> from pylab import *
>>>> x=linspace(-1,1,100)
>>>> y=x
>>>> figure(1)
>>>> p1,=plot(x,y,lw=3)
>>>> savefig("figeps.eps")
>>>> #---jagged line in plot
>>>> http://old.nabble.com/file/p30465591/jagged.png
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30465591.html
>>>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Lotusphere 2011
>>>> Register now for Lotusphere 2011 and learn how
>>>> to connect the dots, take your collaborative environment
>>>> to the next level, and enter the era of Social Business.
>>>> http://p.sf.net/sfu/lotusphere-d2d
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Lotusphere 2011
>>> Register now for Lotusphere 2011 and learn how
>>> to connect the dots, take your collaborative environment
>>> to the next level, and enter the era of Social Business.
>>> http://p.sf.net/sfu/lotusphere-d2d
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30495318.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30555425.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi.
What is the right way to change the x,y text that appears at the right end of the NavigationToolbar? I like it but I would like to change the x value by a function call like:
newx = (time(x))
I am using Qt4 backend. I would like to init a copy of the NavigationToolbar and made the necessary changes. The problem is that I can not find the source code for the NavigationToolbar & qt4.
I am also interesting in deleting the subplot configuration tool icon (not used) but don't know what to do.
Any help is appreciated.
Thanks
 
From: Oz N. T. <na...@gm...> - 2010年12月29日 17:01:40
Hi MicDup,
Try using in your script show(mainloop=True) - if your matplotlib is 1.0.0
Cheers,
-- 
Oz Nahum
---
"Gentlmen! You can't fight in here, this is the War Room!"
President Merkin Muffley
(Peter Sellers, Dr. Strangelove)
From: Michel D. <mic...@ho...> - 2010年12月29日 15:49:07
Hello,
I am new to matplotlib and I am trying to use it 
in a python script that make some calculations.
I have a method "draw" which take as arguments
some values that I want to plot. The method ends 
with a plt.show().
The first time "draw" is called everything is fine.
I see very nice curves. I shut the window 
openned by matplotlib and some other calculations
are performed. But the second time I call "draw" I don't
see anything.
What should I do to make it work ?
Thank you in advance.
MicDup
 		 	 		 
From: crwe c. <cr...@po...> - 2010年12月29日 03:46:58
Thanks Jae-Joon, but my case was so simple that a direct copy&paste from SVG worked as well.
The only trick was recovering the original scale (the SVG plot path is stored in different coordinates), but that was easy too, after reading off positions of the axis scaling ticks from the SVG.
In fact, it was so simple I feel embarrassed to have asked here... but we live and learn, I guess :-)
> ------------ Původní zpráva ------------
> Od: Jae-Joon Lee <lee...@gm...>
> Předmět: Re: [Matplotlib-users] edit EPS
> Datum: 29.12.2010 03:41:39
> ----------------------------------------
> I would try to recover the data from the plot. I often use g3data but
> there should other tools.
> 
> http://www.frantz.fi/software/g3data.php
> 
> IHTH,
> 
> -JJ
> 
> 
> 
> On Wed, Dec 29, 2010 at 9:14 AM, crwe crwe <cr...@po...> wrote:
> > Hello,
> >
> > I need your help! I have an image, saved in .eps (vector) format.
> >
> > Now the image is just a couple of plots with a legend, saved in colour, but
> without special tick marks to differentiate the plots. What I need to do now is
> *add the tick marks*. A diamond to one plot, a little cross for another etc. The
> original data that produced the plots is gone, I only have the .eps to work
> with.
> >
> > I tried editing the image with PIL, but as soon as I load the image it becomes
> rasterized (=a small matrix of pixels, unusably ugly).
> >
> > Is there any way to edit the EPS in matplotlib? Or maybe some other, easier
> way to add the plot marks ex post? I am no expert on vector graphic formats.
> >
> > I'm using py2.5 w/ matplotlib 1.0.0, but can install any other soft if
> necessary.
> >
> > Many thanks!
> >
> >
> >
> ------------------------------------------------------------------------------
> > Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> > to consolidate database storage, standardize their database environment, and,
> > should the need arise, upgrade to a full multi-node Oracle RAC database
> > without downtime or disruption
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> 
> 
> 
From: Jae-Joon L. <lee...@gm...> - 2010年12月29日 02:35:03
I would try to recover the data from the plot. I often use g3data but
there should other tools.
http://www.frantz.fi/software/g3data.php
IHTH,
-JJ
On Wed, Dec 29, 2010 at 9:14 AM, crwe crwe <cr...@po...> wrote:
> Hello,
>
> I need your help! I have an image, saved in .eps (vector) format.
>
> Now the image is just a couple of plots with a legend, saved in colour, but without special tick marks to differentiate the plots. What I need to do now is *add the tick marks*. A diamond to one plot, a little cross for another etc. The original data that produced the plots is gone, I only have the .eps to work with.
>
> I tried editing the image with PIL, but as soon as I load the image it becomes rasterized (=a small matrix of pixels, unusably ugly).
>
> Is there any way to edit the EPS in matplotlib? Or maybe some other, easier way to add the plot marks ex post? I am no expert on vector graphic formats.
>
> I'm using py2.5 w/ matplotlib 1.0.0, but can install any other soft if necessary.
>
> Many thanks!
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: crwe c. <cr...@po...> - 2010年12月29日 02:32:25
Thanks a lot Chris!
I converted the EPS to SVG with InkScape like you suggested. It looks like it might be possible to hack out the original data from the resulting text file. That means I wouldn't have to edit anything, but rather just re-plot (using matplotlib :-).
> > Is there any way to edit the EPS in matplotlib?
> 
> no -- that is not at all what MPL is about.
Out of curiousity (I know nothing of how EPS works internally)---why is this a problem? I mean, MPL can output plots to EPS, but cannot add more plots to an existing EPS? Sounds strange.
Anyway, thanks again for the prompt reply, it helped a lot.
From: Jae-Joon L. <lee...@gm...> - 2010年12月29日 02:25:54
Benjamin,
Can you post the eps file?
With matplotlib from the svn, everything is fine in my system.
Regards,
-JJ
On Thu, Dec 16, 2010 at 12:47 AM, Benjamin Root <ben...@ou...> wrote:
> On Wed, Dec 15, 2010 at 6:25 AM, Teng Liu <lew...@gm...> wrote:
>>
>> Linux 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:48:22 UTC 2010 i686
>> GNU/Linux
>> matplotlib 0.99.1.1
>> The script below is copied from
>> http://matplotlib.sourceforge.net/examples/pylab_examples/hatch_demo.html
>> It works. But it can not be saved as an eps file.
>> I have a lot of histogram plots using "hatch" needed to be saved as eps,
>> is it possible to fix this bug?
>> Thanks.
>>
>> """
>>
>>
>>
>> Hatching (pattern filled polygons) is supported currently in the PS,
>> PDF, SVG and Agg backends only.
>> """
>> import matplotlib.pyplot as plt
>>
>>
>>
>> from matplotlib.patches import Ellipse, Polygon
>>
>> fig = plt.figure()
>>
>>
>>
>> ax1 = fig.add_subplot(131)
>> ax1.bar(range(1,5), range(1,5), color='red', edgecolor='black', hatch="/")
>>
>>
>>
>> ax1.bar(range(1,5), [6] * 4, bottom=range(1,5), color='blue',
>> edgecolor='black', hatch='//')
>>
>>
>>
>> ax1.set_xticks([1.5,2.5,3.5,4.5])
>>
>>
>> ax2 = fig.add_subplot(132)
>> bars = ax2.bar(range(1,5), range(1,5), color='yellow', ecolor='black') + \
>>
>>
>>
>> ax2.bar(range(1, 5), [6] * 4, bottom=range(1,5), color='green',
>> ecolor='black')
>>
>>
>>
>> ax2.set_xticks([1.5,2.5,3.5,4.5])
>>
>>
>> patterns = ('-', '+', 'x', '\\', '*', 'o', 'O', '.')
>>
>>
>>
>> for bar, pattern in zip(bars, patterns):
>>
>> bar.set_hatch(pattern)
>>
>> ax3 = fig.add_subplot(133)
>>
>>
>>
>> ax3.fill([1,3,3,1],[1,1,2,2], fill=False, hatch='\\')
>>
>>
>>
>> ax3.add_patch(Ellipse((4,1.5), 4, 0.5, fill=False, hatch='*'))
>>
>>
>>
>> ax3.add_patch(Polygon([[0,0],[4,1.1],[6,2.5],[2,1.4]], closed=True,
>>
>>
>>
>> fill=False, hatch='/'))
>>
>> ax3.set_xlim((0,6))
>> ax3.set_ylim((0,2.5))
>>
>>
>>
>>
>> plt.show()
>>
>>
> I was able to run this script and save the eps file just fine. However, the
> resulting image is completely wrong. I have attached a screenshot of the
> eps file as viewed in evince. Essentially, all of the hatching elements are
> not at all what they are supposed to be.
>
> Ben Root
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2010年12月29日 02:23:37
On Wed, Dec 15, 2010 at 9:25 PM, Teng Liu <lew...@gm...> wrote:
> But it can not be saved as an eps file.
Can you elaborate what you mean by this?
Does it raise an exception? Or the output is wrong?
-JJ
From: Jae-Joon L. <lee...@gm...> - 2010年12月29日 02:05:06
Attachments: boxstyle_circle.py
With bbox parameter, you can draw a box (or a path) around a text.
http://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-text-with-box
There a several box styles, but unfortunately no circle. However, you
can create a custom box style.
http://matplotlib.sourceforge.net/users/annotations_guide.html#define-custom-boxstyle
Attached is an modified example in the above link that draws a circle.
IHTH,
-JJ
On Mon, Dec 27, 2010 at 6:27 AM, Nathann Cohen <nat...@gm...> wrote:
> Hello everybody !!!
>
> When adding some text to a plot, is there a way to know the actual
> size of the letters as they appear, in such a way that I could, for
> instance, draw a circle around a 'A', so that the A perfectly fits
> inside ("the smallest circle containing the letter"), regardless of
> the actual size of the picture I'm drawing ?
>
> Pray excuse me if my question has an obvious answer... I am working on
> Sage's library (http://www.sagemath.org/) which uses Matplotlib...
> This code is not very clear to me, not to mention it is my first
> contact with Matplotlib... Thank you for your extreme patience :-)
>
> Nathann
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Christopher B. <Chr...@no...> - 2010年12月29日 00:37:58
On 12/28/10 4:14 PM, crwe crwe wrote:
> I need your help! I have an image, saved in .eps (vector) format.
>
> Now the image is just a couple of plots with a legend, saved in colour, but without special tick marks to differentiate the plots. What I need to do now is *add the tick marks*. A diamond to one plot, a little cross for another etc. The original data that produced the plots is gone, I only have the .eps to work with.
darn!
> I tried editing the image with PIL, but as soon as I load the image it becomes rasterized (=a small matrix of pixels, unusably ugly).
right, PIL is a raster tool. There is some hope that you could have PIL 
rasterize it with much higher resolution for better quality, but it's 
really not what you are looking for.
> Is there any way to edit the EPS in matplotlib?
no -- that is not at all what MPL is about.
> Or maybe some other, easier way to add the plot marks ex post? I am no expert on vector graphic formats.
I'd use a vector graphics program. EPS is almost the same as Adobe 
Illustrator's format, for instance.
InkScape is a really nice cross platform open source vector graphics 
tool. It's native format is SVG. I'll bet you could find a way to 
convert the EPS to svg, or, if you're lucky, InkScape can read EPS.
The nice thing about SVG is that being XML, you may be able to 
manipulate it directly with a python script or something, if you have 
many similar plots to do, so you don't have to point and click on each one.
Inkscape can be used as a command line SVG renderer, too.
Good luck!
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: crwe c. <cr...@po...> - 2010年12月29日 00:14:55
Hello,
I need your help! I have an image, saved in .eps (vector) format. 
Now the image is just a couple of plots with a legend, saved in colour, but without special tick marks to differentiate the plots. What I need to do now is *add the tick marks*. A diamond to one plot, a little cross for another etc. The original data that produced the plots is gone, I only have the .eps to work with.
I tried editing the image with PIL, but as soon as I load the image it becomes rasterized (=a small matrix of pixels, unusably ugly). 
Is there any way to edit the EPS in matplotlib? Or maybe some other, easier way to add the plot marks ex post? I am no expert on vector graphic formats.
I'm using py2.5 w/ matplotlib 1.0.0, but can install any other soft if necessary.
Many thanks!
From: Paul I. <piv...@gm...> - 2010年12月28日 10:27:41
Nathann Cohen, on 2010年12月26日 22:27, wrote:
> Hello everybody !!!
> 
> When adding some text to a plot, is there a way to know the actual
> size of the letters as they appear, in such a way that I could, for
> instance, draw a circle around a 'A', so that the A perfectly fits
> inside ("the smallest circle containing the letter"), regardless of
> the actual size of the picture I'm drawing ?
Hi Nathann,
Here's a quick and dirty way of getting what you want:
 import matplotlib.pyplot as plt
 import numpy as np
 ax = plt.subplot(111)
 t = plt.text(0.5,0.5,'A', ha='center', va='center')
 plt.draw()
 b = t.get_window_extent() # bounding box in pixel coordinates
 r = np.sqrt((b.bounds[-2]/2)**2 + (b.bounds[-1]/2)**2)
 plt.scatter(0.5,0.5, s=np.pi*r**2, marker='o', edgecolor='k', facecolor='w', lw=1,zorder=-1)
I don't think there's a super simple way of doing this by hand -
because text keeps its size constant regardless of how you
manipulate the axes. Here's an example that does what you want,
if you only need the circle in one particular view (i.e. if you
won't be rescaling/zooming in or out the axes:
 ax = plt.subplot(111)
 plt.plot([0,1,1],[0,0,1]) # keep the axes from resizing when we draw our circle
 t = plt.text(0.5,0.5,'A')
 plt.axis('equal')
 plt.draw()
 b = t.get_window_extent() # bounding box in pixel coordinates
 bbox = b.inverse_transformed(ax.transData)
 xc,yc = bbox.get_points().mean(0)
 r = np.sqrt((bbox.bounds[-2]/2)**2 + (bbox.bounds[-1]/2)**2)
 theta = np.linspace(0,2*np.pi,200)
 x,y = r*(np.cos(theta)), r*np.sin(theta)
 l = plt.plot(x+xc, y+yc)
This does exactly what you want, but now, anytime you resize the
axes, the A will stay the same size, but that circle will get
resized.
 ax = plt.subplot(111)
 plt.plot([0,1,1],[0,0,1]) # keep the axes from resizing when we draw our circle
 t = plt.text(0.5,0.5,'A')
 plt.axis('equal')
 plt.draw()
 b = t.get_window_extent() # bounding box in pixel coordinates
 bbox = b.inverse_transformed(ax.transAxes)
 xc,yc = bbox.get_points().mean(0)
 r = np.sqrt((bbox.bounds[-2]/2)**2 + (bbox.bounds[-1]/2)**2)
 theta = np.linspace(0,2*np.pi,200)
 x,y = r*(np.cos(theta)), r*np.sin(theta)
 l = plt.plot(x+xc, y+yc, transform=ax.transAxes)
The above will keep the circle from resizing when you move - but
now it prevents the circle from following 'A' as you pan around.
I see that matplotlib.collections (which is what plt.scatter
creates in the quick-and-dirty example) uses offset and
transOffset to get the job done, but I couldn't figure out a way
to get my last two examples to do something similar by just
manipulating the transforms. 
Hopefully someone chimes in with a better solution. For more on
transformations see:
http://matplotlib.sourceforge.net/users/transforms_tutorial.html
And you can wrap my hand-rolled solution nicely using something
like:
http://matplotlib.sourceforge.net/examples/api/line_with_text.html
best, 
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Paul I. <piv...@gm...> - 2010年12月28日 02:39:51
Philippe Piot, on 2010年12月27日 13:58, wrote:
> 1/ When executing the above script, I also display the histograms
> generated when invoking "hist" (I tried to make this line tranparaent
> by using alpha=0 but it did not work).
Hi Philippe,
welcome to matplotlib - I think what you really want to do is
just use numpy's histogram function, and then plot the result.
This is actually the function matplotlib's hist uses behind the
scenes.
> 2/ can I directly manipulate the data within an histogram to
> arbitrarily offset the histogram?
Once you get the histogram using numpy, you can plot it in in any
way you want. Here's a small example:
 import numpy as np
 import matplotlib.pyplot as plt
 h,edges = np.histogram(np.random.randn(1000))
 plt.bar(edges[:-1],h, width=edges[1]-edges[0])
 plt.bar(edges[:-1]-10,h, width=edges[1]-edges[0]) #offset
 plt.step(edges[1:],h) # plot as step lines instead of bars
 plt.step(edges[1:]+10,h) # same as above, with an offset
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Philippe P. <phi...@gm...> - 2010年12月27日 19:59:05
Hello All,
 I am trying to produce a 2D density plot of a distribution and would
like to show the associated projection computed as histogram. I need
to perform an operation on the histogram to offset them.
 Right now I am doing this:
# plot my 2D distribution
 hexbin(x,y, cmap=cm.jet, bins='log',gridsize=151)
# compute the associated projection (I would like not to show them but
use the hist to get the histrgram data)
 ny, binsy, histoy = hist(y, bins=121, normed=1, histtype='step',
color='white')
 nx, binsx, histox = hist(x, bins=121, normed=1, histtype='step',
orientation='horizontal', color='white', alpha=0.0)
# manipulate the histogram data
 Nbinsx = binsx[:-1]
 Nbinsy = binsy[:-1]
# plot offset histogram
 plot (Nbinsx,nx-2.5,color='white')
 plot (ny-2.5, Nbinsy,color='white')
 I have two questions (my apology I am a novice with matplotlib):
1/ When executing the above script, I also display the histograms
generated when invoking "hist" (I tried to make this line tranparaent
by using alpha=0 but it did not work).
2/ can I directly manipulate the data within an histogram to
arbitrarily offset the histogram?
 Thank you for any suggestion. Best, -- Philippe.
From: Yannick C. <yan...@la...> - 2010年12月27日 17:03:04
Hi,
mdekauwe wrote:
> 
> Has anyone ever managed to draw a taylor diagram in Matplotlib? For
> example like this
> 
> http://www.mathworks.com/matlabcentral/fx_files/20559/2/taylordiag_fig.jpg
> 
here is my try [ http://old.nabble.com/file/p30540085/taylorDiagram.py
taylorDiagram.py ] using matplotlib 1.0 (requires floating_axes). This is
heavily based on the 
http://matplotlib.sourceforge.net/examples/axes_grid/demo_floating_axes.html
floating_axes demo (which I find tricky).
I'm sure there're plenty of way to improve the TaylorDiagram class, but I'm
not familiar with all the bells and whistles of axes projections
(furthermore, I'm not sure Taylor diagrams are exactly what I need...). So
feel free to ellaborate!
Cheers,
Yannick
-- 
View this message in context: http://old.nabble.com/Taylor-diagram-tp30421393p30540085.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Åke K. <ake...@gm...> - 2010年12月27日 11:10:34
Is it possible to have autoscale for the yaxis use only the current xlim
rather than the whole series that was plotted?
For example, if I have a 2 year time-series with current xlim set to only
show a 1 year span, how can I get matplotlib to base the autoscale for the
y-axis on the 1 year span and not the full 2 year span?
For a dynamic plot where the user can shift the xlims it would be very nice
to do this directly in matplotlib rather than having to use logic/data
outside of matplotlib.
From: Nathann C. <nat...@gm...> - 2010年12月26日 21:27:23
Hello everybody !!!
When adding some text to a plot, is there a way to know the actual
size of the letters as they appear, in such a way that I could, for
instance, draw a circle around a 'A', so that the A perfectly fits
inside ("the smallest circle containing the letter"), regardless of
the actual size of the picture I'm drawing ?
Pray excuse me if my question has an obvious answer... I am working on
Sage's library (http://www.sagemath.org/) which uses Matplotlib...
This code is not very clear to me, not to mention it is my first
contact with Matplotlib... Thank you for your extreme patience :-)
Nathann
From: zb <za...@ya...> - 2010年12月26日 14:19:04
Hi.
First of all, I would like to thank the developers of this wonderful package.
I started doing an app and I finally tried to compile it with py2exe. I run into some issues that I posted in the py2exe group here;
http://sourceforge.net/mailarchive/forum.php?thread_name=ienv6p%24b42%241%40dough.gmane.org&forum_name=py2exe-users
To make it work, I ended it up having to use an older version of matplotlib and numpy. I don't know if the developers of matplotlib are aware of these issues and I am posting here just in case they don't know.
When I was trying to use version 1.0, I run into problems with the mpl data directory. The output of py2exe could only find the mpl-data dir at the root /dist of a drive. Then I decided to try a much earlier version of matplotlib, and I run into different set of problems. Finally, I tried matplotlib 0.99.1 and the problems went away (I didn't try version 0.99.3 because its release date was too close to the version 1.0).
I am just trying to make the developers aware of the problems and I hope to use newer versions in the future.
Thanks for your attention
 
From: Robert Y. <Rob...@as...> - 2010年12月23日 23:01:54
Thank you for your fast reply and suggestion. I downloaded the GNU tar
ball and looked at it. Unfortunately due to my own limitations, I need
a win32 installer.
I'll have to bide my time I guess.
RDY
-----Original Message-----
From: Christoph Gohlke [mailto:cg...@uc...] 
Sent: Thursday, December 23, 2010 2:47 PM
To: mat...@li...
Subject: Re: [Matplotlib-users] Python 3
On 12/23/2010 1:01 PM, Robert Young wrote:
> Hi, I have used Matplotlib extensively now for 2 years with python
2.x.
> I recently needed to move to python 3.1 which was greatly facilitated
by
> numpy and scipy being ported to python 3. I was lucky in that all I
have
> to change is many print statements. All on a Windows OS.
>
> But my progress is severely limited by having no port of Matplotlib to
> python 3. I am definitely a user so have contributed twice to
Matplotlib
> development.
>
> Plea: If the stars align properly, I would be so grateful for a port
of
> matplotlib to python 3.
>
> Thanks for hearing me.
>
Did you try the py3k branch at 
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/branches/py3k/>
? It 
does work for simple plots.
--
Christoph
------------------------------------------------------------------------
------
Learn how Oracle Real Application Clusters (RAC) One Node allows
customers
to consolidate database storage, standardize their database environment,
and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Christoph G. <cg...@uc...> - 2010年12月23日 21:47:04
On 12/23/2010 1:01 PM, Robert Young wrote:
> Hi, I have used Matplotlib extensively now for 2 years with python 2.x.
> I recently needed to move to python 3.1 which was greatly facilitated by
> numpy and scipy being ported to python 3. I was lucky in that all I have
> to change is many print statements. All on a Windows OS.
>
> But my progress is severely limited by having no port of Matplotlib to
> python 3. I am definitely a user so have contributed twice to Matplotlib
> development.
>
> Plea: If the stars align properly, I would be so grateful for a port of
> matplotlib to python 3.
>
> Thanks for hearing me.
>
Did you try the py3k branch at 
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/branches/py3k/>? It 
does work for simple plots.
--
Christoph
8 messages has been excluded from this view by a project administrator.

Showing results of 194

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