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 10 results of 10

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!

Showing 10 results of 10

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