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



Showing results of 408

<< < 1 .. 12 13 14 15 16 17 > >> (Page 14 of 17)
From: Fernando P. <fpe...@gm...> - 2012年02月07日 17:20:05
On Tue, Feb 7, 2012 at 9:02 AM, Ethan Gutmann <eth...@gm...> wrote:
>
> Also, congrats Ben, both on finishing the PhD and on the job. If you ever find yourself in Boulder, CO (I'm at NCAR), let me know and I'll buy you a drink.
Indeed, congrats to Ben! And I'm very glad to see your many
contributions to the project finding acknowledgment and long-term
benefits for you.
BTW Ethan, it's been a few years since the last time that John Hunter
and I lectured at NCAR (Dec. 2007), but in early April Min
Ragan-Kelley and I will be teaching at a workshop at CU, focusing on
data analysis with the 'scipy stack' and ipython's parallel machinery.
 This will be in the context of a genomics workshop on campus, but if
you are interested we might be able to meet up with some of the python
crowd at NCAR...
Just let me know if you are interested; best to write to
fer...@be..., as I sometimes stop monitoring mailing
lists if I get swamped.
Cheers,
f
From: Paul I. <piv...@gm...> - 2012年02月07日 17:12:28
C M, on 2012年02月06日 09:33, wrote:
> On Mon, Feb 6, 2012 at 9:23 AM, David Craig <dcd...@gm...> wrote:
> 
> > Hi, I have a plot and the xaxis shows number of seconds after a start
> > point. I would like to convert them to days anyone know how to do this.
> > I have looked at the documentation but cant find what I need.
> 
> Couldn't you divide your data points by the conversion (86400) before
> plotting? E.g., 432,000 seconds then becomes 5 days.
Another way to do this is to change the Formatter which generates
what the labels of each tick out to be to do this computation.
Take a look at this example:
http://matplotlib.sourceforge.net/examples/api/date_index_formatter.html
Just define something like:
def your_function(x,pos=None):
 return "%d days" % (x/86400)
ax.xaxis.set_major_formatter(ticker.FuncFormatter(your_function))
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Ethan G. <eth...@gm...> - 2012年02月07日 17:02:51
On Feb 7, 2012, at 1:42 AM, Friedrich Romstedt wrote:
> I'd like to thank John and Ben for this inspiring posts, which showed
> them from a side I've never seen so far. Show your hands if you're
> thinking the same. I hope I didn't bore you all :-)
Well said Friedrich, though I'm a relative newcomer to python/matplotlib, I've been on the peripheral of a lot of open source, and I've enjoyed this thread. 
Also, congrats Ben, both on finishing the PhD and on the job. If you ever find yourself in Boulder, CO (I'm at NCAR), let me know and I'll buy you a drink. 
ethan
From: Paul I. <piv...@gm...> - 2012年02月07日 16:55:29
Hi Phil,
phils, on 2012年02月04日 07:41, wrote:
> Newbie to using matplotlib
welcome to the party :)
 
> Is it possible to use wx and have a window with say 2 buttons on where when
> clicking on either button a different graph will appear using a different
> data set. Any examples?
Yes, it's possible. Here's a modified version of
examples/event_handling/keypress_demo.py which toggles between
two different axes when you press the 'w' key on your keyboard:
one has green points connected by dashed lines, the other with
multi-colored multi-sized scatter data.
--------
import numpy as np
import matplotlib.pyplot as plt
plt.close('all')
def press(event):
 print('press', event.key)
 if event.key=='w':
 visible = ax.get_visible()
 ax.set_visible(not visible)
 ax2.set_visible(visible)
 fig.canvas.draw()
fig = plt.figure()
ax = fig.add_axes([.1,.1,.8,.8], label='one')
ax2 = fig.add_axes([.1,.1,.8,.8], label='two')
ax2.set_visible(False)
fig.canvas.mpl_connect('key_press_event', press)
ax.plot(np.random.rand(12), np.random.rand(12), 'go--')
ax2.scatter(100*np.random.rand(12), 100*np.random.rand(12),
 c=np.random.rand(12), s=np.random.rand(12)*100)
plt.show()
--------
I don't want to take away all of your fun, so have a look at
adding (mouse clickable) buttons to this using either
examples/widgets/buttons.py or examples/widgets/radio_buttons.py
- depending on your preference.
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
On 02/07/2012 10:48 AM, Benjamin Root wrote:
>
>
> On Tue, Feb 7, 2012 at 8:33 AM, Fabien Lafont <laf...@gm... 
> <mailto:laf...@gm...>> wrote:
>
> Is it possible to set the extension .pdf as defaut when I save an
> image using the matplotlib bar. My coworkers are always saving the
> image in png and it's really ugly!
>
> Thx,
>
> Fab
>
>
> Interesting request. Looking through the backends, it appears that 
> only the Cairo backend currently supports a configurable rcParam for 
> the default filetype ('cairo.format'). All backends implement a 
> "get_default_filetype()" method for their canvases, but most of them 
> have that default hard-coded as "png". This really only makes sense 
> for backends like agg, pdf, ps and such.
>
> Devs - Maybe we should consider fixing this for the non-fileformat 
> specific backends? Do we want an rcParam for each backend? Or a 
> single rcParam for default filetypes and deprecate 'cairo.format'?
I would definitely lean toward the latter -- unify it under a single 
rcParam.
Mike
From: Gökhan S. <gok...@gm...> - 2012年02月07日 16:40:52
Is there a way in matplotlib to partially specify the color of a string?
Example:
plt.ylabel("Today is cloudy.")
How can I show "today" as red, "is" as green and "cloudy." as blue?
Thanks.
PS: Asked also on
http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib
-- 
Gökhan
On Tue, Feb 7, 2012 at 8:33 AM, Fabien Lafont <laf...@gm...>wrote:
> Is it possible to set the extension .pdf as defaut when I save an
> image using the matplotlib bar. My coworkers are always saving the
> image in png and it's really ugly!
>
> Thx,
>
> Fab
>
>
Interesting request. Looking through the backends, it appears that only
the Cairo backend currently supports a configurable rcParam for the default
filetype ('cairo.format'). All backends implement a
"get_default_filetype()" method for their canvases, but most of them have
that default hard-coded as "png". This really only makes sense for
backends like agg, pdf, ps and such.
Devs - Maybe we should consider fixing this for the non-fileformat specific
backends? Do we want an rcParam for each backend? Or a single rcParam for
default filetypes and deprecate 'cairo.format'?
Cheers!
Ben Root
From: Michael D. <md...@st...> - 2012年02月07日 14:55:56
It looks like perhaps we'll need to "synthesize" glyph names if they 
aren't provided in the font (though it's not clear to me why they are 
not). This will be difficult to test for, as that's a proprietary 
font. Have you tried using another Unicode font, such as DejaVu Sans?
Mike
On 02/06/2012 06:53 PM, Mark Janikas wrote:
>
> Hi All,
>
> I am having trouble rendering my Unicode strings in matplotlib using 
> the PDF backend. When I use certain fonts (like the Win 7 default), 
> I get no complaints but the characters are not rendered.... When I use 
> a font like Arial Unicode MS, that I know contains all the chars, then 
> I get the error message below. I did in fact, find a tty file that 
> would work with Chinese ("Microsoft YaHei"), but I would like to avoid 
> trying to map font files to languages. Any info on this subject would 
> be greatly appreciated. Here is a snippet that reproduces the error 
> below... if you remove the fontproperties option to the PYLAB.xlabel() 
> call then the error is avoided but the result is not rendered. Thanks 
> so much!
>
> MJ
>
> import matplotlib.pyplot as PLT
>
> import pylab as PYLAB
>
> from matplotlib.backends.backend_pdf import PdfPages as PDF
>
> import matplotlib.font_manager as fm
>
> fontFile = r'C:\Windows\Fonts\ARIALUNI.TTF'
>
> fp1 = fm.FontProperties(fname=fontFile)
>
> reportFile = r'C:\Temp\TestUnicode.pdf'
>
> pdfOutput = PDF(reportFile)
>
> vals = range(100)
>
> PLT.plot(vals, vals, color = "r", linestyle = "-")
>
> mess = u'\u6B63\u5728\u8BFB\u53D6\u6570\u636E...'
>
> PYLAB.xlabel(mess, fontproperties = fp1)
>
> PLT.savefig(pdfOutput, format='pdf')
>
> PLT.close()
>
> pdfOutput.close()
>
> Traceback (most recent call last):
>
> File 
> "C:\Data\CRs10円.1\MemLeak\matplotlib\Scripts\matplotlib_unicode.py", 
> line 27, in <module>
>
> PLT.savefig(pdfOutput, format='pdf')
>
> File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 472, 
> in savefig
>
> return fig.savefig(*args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 
> 1173, in savefig
>
> self.canvas.print_figure(*args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", 
> line 2027, in print_figure
>
> **kwargs)
>
> File 
> "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", 
> line 2181, in print_pdf
>
> self.figure.draw(renderer)
>
> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, 
> in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 886, 
> in draw
>
> func(*args)
>
> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, 
> in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1983, 
> in draw
>
> a.draw(renderer)
>
> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, 
> in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1054, 
> in draw
>
> self.label.draw(renderer)
>
> File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, 
> in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python27\lib\site-packages\matplotlib\text.py", line 587, 
> in draw
>
> ismath=ismath)
>
> File 
> "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", 
> line 1784, in draw_text
>
> return draw_text_woven(chunks)
>
> File 
> "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", 
> line 1754, in draw_text_woven
>
> glyph_name = font.get_glyph_name(gind)
>
> RuntimeError: Face has no glyph names
>
> PS. I cannot use a different backend.
>
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Is it possible to set the extension .pdf as defaut when I save an
image using the matplotlib bar. My coworkers are always saving the
image in png and it's really ugly!
Thx,
Fab
From: Friedrich R. <fri...@gm...> - 2012年02月07日 08:42:16
2012年2月7日 John Hunter <jd...@gm...>:
> On Mon, Feb 6, 2012 at 1:59 PM, Benjamin Root <ben...@ou...> wrote:
>> [...]
>
> [...]
>
>> About a week later, I got a personal email from the original poster
>> informing me that my solution worked perfectly. He also noticed that I was
>> working in a neighboring building on campus and wondered just how much
>> longer my PhD was going to take and if I had any interest in going into the
>> private sector. (The company happened to deal with atmospheric science and
>> my PhD is in meteorology).
>
> I love that a tiny bit of altruism turned into a good job for you.
> [...]
>
> [...]
John, I agree fully with you on the altruism, but I think there is
more to Open Source than just altruism.
I'm currenty trying to convice me to work on publishing my
matplotlayers project, which is a mature but in some parts incomplete
project to add layers on top of matplotlib, and connect layers with
colorbars, all intended to make the data more dynamic and take the
update process off the user. But that as a side note, it might be
necessary to understand the procrastination character of this email.
I just have trouble understanding *why the hell I should do that*. I
think that's a rather general question of life. And the answer of OSS
to this is, AISI: Good programming is like good art. It shows you, in
the case of programming, that things just work, instead of having easy
talk, instead of dwelling on the only shallow and only apparently deep
"wisdom" that is too tempting – the ideas, the planning, all that
things that are up in the air but never turn into truth. What I do
like of matplotlib, is that it just happened, that it works, at least
mostly, and that everyone with a basic understanding of Python can
verify fully independently that it really works, is truth, and to what
extent it works, and where it stops working. What I don't like about
matplotlib, is that so many details are solved not thoroughly. But
that's a matter of taste. And I guess, as talk is easy, that's the
reason why I wrote matplotlayers, just to help overcoming that part.
And this is what connects matplotlib and all OSS with art for me: Just
do it. Show and experience the deepness of life when it comes to the
kernel of it. There is more to it than altruism.
Altruism is directed to other people, or, let's say, when we stress
the altruistic character of OSS, we mean the mailing lists, where we
help each other, if we can, where the conversation partner is in mind.
 As I said, what I mean, is that part of OSS that makes the code
happen, the dark or not dark rooms with the keyboards or nowadays the
laptops, where everyone dies on his own, where is no conversation
partner at first, where we all stand on our own, where we have to
overcome the procrastination. This is something much more personal,
something much more "egoistic", or better, avoiding the word "ego",
something much more selfless. To be a good OSS dev or try to become
one one needs to train one's selflessness. Maybe that is the reason
why the people doing it make it free of cost, just as a side effect of
this selflessness, when I did it just for me anyway, it doesn't matter
if I make it public in the end too; making people pay for it would
spoil the whole feeling.
Of course we are paid sometimes, but I see that as a side effect.
First the work, then the payment. The work is to make yourself a
name, to show you're capable and determined, and all this stuff which
comes for free. I see this effect of success as the ingredient of
fate to a good dev – fate rewards the selflessness, at least to my
experience. It just pays better. People will be interested in
investing in you if you show that you do it just for youself, that you
are really interested in what you do, etc. pp. – people will tend to
let you die alone if you make the appearance of doing it just for the
money. Of course that depends a bit on socialisation; meaning on the
people around you. But there's also an active component of
socialisation; one has some influence on it, let it be with or without
noticing it.
I'd like to thank John and Ben for this inspiring posts, which showed
them from a side I've never seen so far. Show your hands if you're
thinking the same. I hope I didn't bore you all :-)
Friedrich
From: John H. <jd...@gm...> - 2012年02月07日 02:30:59
On Mon, Feb 6, 2012 at 1:59 PM, Benjamin Root <ben...@ou...> wrote:
> Alternate title: "How I finally convinced my Dad that open-source can put
> food on the table". Since this entire story got started on this mailing
> list, I figured it would be appropriate to end it here.
Love the alternate title. I'm sure we can all substitute
dad|mom|wife|husband|significant_other in that one.
> About a week later, I got a personal email from the original poster
> informing me that my solution worked perfectly. He also noticed that I was
> working in a neighboring building on campus and wondered just how much
> longer my PhD was going to take and if I had any interest in going into the
> private sector. (The company happened to deal with atmospheric science and
> my PhD is in meteorology).
I love that a tiny bit of altruism turned into a good job for you.
Recently my wife, who is a criminal defense attorney, decided to
transition from criminal law to family law, and took on a pro-bono
case of a friend who was in a tough spot (he was accused of spousal
battery by a mentally ill wife and they had several young kids in the
middle). At a Halloween party, she met someone who worked at a family
law firm and began telling him about her case, and that led to a job
interview and soon she'll be having her third interview with the firm.
 I don't know how it will turn out, but I'm pretty sure that she
wouldn't have gotten this opportunity had she not taken on this case
pro-bono.
I grew up pretty much accepting the US ethos that 'there is no such
thing as free lunch" and "no one works for free". So it came as a
great surprise to me, sometime in 1994-1995, when I posted a question
on comp.lang.awk about a script I was developing mixing sed and awk
which parsed BibTeX. Some kind soul responded withing 12 hours, "you
should really be using Perl for this", *and* wrote a non-trivial,
several hundred line piece of Perl to solve my problem. I was
dumbstruck that someone would stay up all night solving a problem for
me, not looking for anything except perhaps for "credit". What I
learned next was that altruism is infectious. I began diving deeply
into Perl, mastering it, and answering other people's questions on the
Perl mailing list. At one point, I was one of the top ten posters on
the Perl mailing list -- no mean feat at the time -- mainly
obsessively answering people's questions. Of course when I discovered
Python, I dropped Perl faster than a hot potato, but that spirit of
contributing to and benefiting from a community of people motivated
not by a payback but by contributing to and participating in something
excellent persisted. That free help that guy gave me on comp.lang.awk
probably caused me to spend 8,000 hours over the next decade helping
other people. I guess there is no such thing as free lunch.
> It turned out that the company realized the value of having on-staff a
> "SciPy Guru" (I still consider myself a beginner). After the usual visits
> and interviews, I was offered a position. At multiple times throughout the
> process, it was obvious to me that while it was good that I was an
> atmospheric scientist, what was most valuable to them was my knowledge,
> insight and expertise with Python and its tools.
>
> The lesson I hope everyone here can take in is that there are many companies
> out there that are using open-source tools and libraries for their
> purposes. Learning and using these tools for your own purposes not only
> solves your immediate needs, but also sets you up for future opportunities.
No doubt about this one. I have tried with mixed success on a number
of occasions to hire people for a job in quantitative finance who
possess skills in scientific python tools as well as statistics, and
it is hard to find good matches. Whenever I meet other people like me
who are trying to hire people, they all tell the same tale: it's hard
to find talent. So if you have these skills and would like a job,
contact me :-)
I've been astounded by the degree of uptake of the scientific python
toolset, and it is accelerating. As more and more people use these
tools, more and more companies require them and most importantly, more
and more talented developers put their energies into them. The amount
of productivity being poured into not only the core tools but also
pandas, scikits-learn, scikits-image, pystatsmodels and others is
awesome, and is definitely taking the tool chain to the next level.
> Therefore, I would like to thank John Hunter for making matplotlib available
> for the community, and a hearty thanks to the rest of the community for
> their contributions to matplotlib. Without this, I doubt I would have found
> this job opportunity, nor have the "value-added" skills to have them
> consider hiring me.
You're welcome, but I owe you a significant thanks as well. As my
time for significant development has dwindled, the major contributions
by you and the other developers has enabled the project to thrive. I
hope that in your new position, you can continue to devote some time
to core development. Congrats on the new job, and thanks for sharing
the story.
JDH
From: Mark J. <mja...@es...> - 2012年02月06日 23:54:06
Hi All,
I am having trouble rendering my Unicode strings in matplotlib using the PDF backend. When I use certain fonts (like the Win 7 default), I get no complaints but the characters are not rendered.... When I use a font like Arial Unicode MS, that I know contains all the chars, then I get the error message below. I did in fact, find a tty file that would work with Chinese ("Microsoft YaHei"), but I would like to avoid trying to map font files to languages. Any info on this subject would be greatly appreciated. Here is a snippet that reproduces the error below... if you remove the fontproperties option to the PYLAB.xlabel() call then the error is avoided but the result is not rendered. Thanks so much!
MJ
import matplotlib.pyplot as PLT
import pylab as PYLAB
from matplotlib.backends.backend_pdf import PdfPages as PDF
import matplotlib.font_manager as fm
fontFile = r'C:\Windows\Fonts\ARIALUNI.TTF'
fp1 = fm.FontProperties(fname=fontFile)
reportFile = r'C:\Temp\TestUnicode.pdf'
pdfOutput = PDF(reportFile)
vals = range(100)
PLT.plot(vals, vals, color = "r", linestyle = "-")
mess = u'\u6B63\u5728\u8BFB\u53D6\u6570\u636E...'
PYLAB.xlabel(mess, fontproperties = fp1)
PLT.savefig(pdfOutput, format='pdf')
PLT.close()
pdfOutput.close()
Traceback (most recent call last):
 File "C:\Data\CRs10円.1\MemLeak\matplotlib\Scripts\matplotlib_unicode.py", line 27, in <module>
 PLT.savefig(pdfOutput, format='pdf')
 File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 472, in savefig
 return fig.savefig(*args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 1173, in savefig
 self.canvas.print_figure(*args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 2027, in print_figure
 **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2181, in print_pdf
 self.figure.draw(renderer)
 File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 886, in draw
 func(*args)
 File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1983, in draw
 a.draw(renderer)
 File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1054, in draw
 self.label.draw(renderer)
 File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python27\lib\site-packages\matplotlib\text.py", line 587, in draw
 ismath=ismath)
 File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1784, in draw_text
 return draw_text_woven(chunks)
 File "C:\Python27\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1754, in draw_text_woven
 glyph_name = font.get_glyph_name(gind)
RuntimeError: Face has no glyph names
PS. I cannot use a different backend.
From: C M <cmp...@gm...> - 2012年02月06日 22:39:41
On Mon, Feb 6, 2012 at 2:59 PM, Benjamin Root <ben...@ou...> wrote:
> Alternate title: "How I finally convinced my Dad that open-source can put
> food on the table". Since this entire story got started on this mailing
> list, I figured it would be appropriate to end it here.
>
Inspiring and uplifting story, Ben. I'm glad you posted it.
Congratulations on your new job! (That's also interesting that your father
even knows what open-source is).
Che
From: Paul I. <piv...@gm...> - 2012年02月06日 21:52:16
Benjamin Root, on 2012年02月06日 13:59, wrote:
> Alternate title: "How I finally convinced my Dad that open-source can put
> food on the table". Since this entire story got started on this mailing
> list, I figured it would be appropriate to end it here.
> 
> Last Friday, I signed a contract to begin working as a "Senior Scientific
> Programmer" for a research company. 
Congrats on the new job, Ben! Great story, I could say that it
had me "Root-ing" for you - but that would make you groan from
the number of times you've probably heard it before, so I'm not
gonna do that ;)
> Lastly, a reminder to everyone on this list, I hope this encourages more of
> you to help each other out with answers. You never know if the person you
> help out is your future co-worker!
Hope this doesn't mean you'll be posting less, now :)
I want to second Ben's comments: I learned (and continue to
learn) quite a bit about matplotlib by trying to answer the
questions others have (with my trusty IPython tab-completion, and
when necessary, doing what every Python Jedi does, and use the
Source) - and by following along with the answers others provide.
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Benjamin R. <ben...@ou...> - 2012年02月06日 19:59:37
Alternate title: "How I finally convinced my Dad that open-source can put
food on the table". Since this entire story got started on this mailing
list, I figured it would be appropriate to end it here.
Last Friday, I signed a contract to begin working as a "Senior Scientific
Programmer" for a research company. The company has recently begun making
Python the "preferred language for new development" and has become heavily
dependent upon NumPy, SciPy and matplotlib. They have been doing fairly
well for a while now, but a few months ago, they ran into a problem with
matplotlib. After spending a few weeks butting heads on it, they finally
decided to post a question about it to the matplotlib-users list. After
reading the question and seeing the code example, I replied with a one-line
fix within half an hour of its posting and moved on.
About a week later, I got a personal email from the original poster
informing me that my solution worked perfectly. He also noticed that I was
working in a neighboring building on campus and wondered just how much
longer my PhD was going to take and if I had any interest in going into the
private sector. (The company happened to deal with atmospheric science and
my PhD is in meteorology).
It turned out that the company realized the value of having on-staff a
"SciPy Guru" (I still consider myself a beginner). After the usual visits
and interviews, I was offered a position. At multiple times throughout the
process, it was obvious to me that while it was good that I was an
atmospheric scientist, what was most valuable to them was my knowledge,
insight and expertise with Python and its tools.
The lesson I hope everyone here can take in is that there are many
companies out there that are using open-source tools and libraries for
their purposes. Learning and using these tools for your own purposes not
only solves your immediate needs, but also sets you up for future
opportunities.
Therefore, I would like to thank John Hunter for making matplotlib
available for the community, and a hearty thanks to the rest of the
community for their contributions to matplotlib. Without this, I doubt I
would have found this job opportunity, nor have the "value-added" skills to
have them consider hiring me.
Lastly, a reminder to everyone on this list, I hope this encourages more of
you to help each other out with answers. You never know if the person you
help out is your future co-worker!
Cheers!
Ben Root
From: David C. <dcd...@gm...> - 2012年02月06日 19:56:56
uname -a gives,
Linux David 3.2.2-1.fc16.i686 #1 SMP Thu Jan 26 03:38:31 UTC 2012 i686 i686
i386 GNU/Linux
On Mon, Feb 6, 2012 at 6:07 PM, Benjamin Root <ben...@ou...> wrote:
>
>
> On Mon, Feb 6, 2012 at 11:59 AM, David Craig <dcd...@gm...> wrote:
>
>> I'm using a lenovo laptop with fedora 16. It has 2.9 GiB memory and 4
>> intel core CPUs @ 2.3GHz each. Available disk space is 147.9GiB.
>> numpy 1.6.0
>> matplotlib 1.0.1
>>
>>
> 32-bit or 64-bit OS? Please use 'uname -a' to tell us, because you can
> install a 32-bit OS on a 64-bit machine.
>
> Ben Root
>
>
From: Michael D. <md...@st...> - 2012年02月06日 19:29:05
There is a pull request for this here:
https://github.com/matplotlib/matplotlib/pull/695
If you're able to checkout and build that branch from git, I would 
appreciate hearing if it resolves your issue.
Mike
On 02/06/2012 12:58 PM, Chris wrote:
> JJ,
>
> Thanks for the clarification. Now I understand why EPS outputs of
> pixel plot from mpl is a few times bigger than those from SuperMongo.
> I guess that mpl uses the square implementation for pixel so that it
> would use the same method to handle all marker types. I will file an
> issue report on git. Meanwhile, is there any easy workaround?
>
> Jonathan,
>
> Tom Robitaille's module does help reducing file size of postscript,
> but by rasterize a scalable plot. It doesn't really help my problem
> since the markers are still drawn with the same method as other
> plotting methods.
>
> Bests,
> Chris
>
>
> On Mon, Feb 6, 2012 at 4:28 AM, Jae-Joon Lee<lee...@gm...> wrote:
>> Thanks. Now I understand the situation.
>>
>> As far as I can see, marker="," is implemented as a rectangle path
>> with width/height of 1 pixel, so this result in 2x2 pixel filled
>> square.
>> I tried to change the size of the rectangle, etc, to get a single
>> pixel filled square, but did not get a satisfactory result.
>> I think we need an Agg expert. I hope Mike or others take a look.
>>
>> Chris,
>> if you do not get a response from others in this mailing list, I
>> recommend you to open a new issue in our github page.
>>
>> Regards,
>>
>> -JJ
>>
>
> On Mon, Feb 6, 2012 at 6:19 AM, Jonathan Slavin<js...@cf...> wrote:
>> Chris,
>>
>> You might want to try a module written by Tom Robitaille (aka astrofrog)
>> called rasterized_scatter. Look for it on github.
>>
>> Jon
>>
>> On Mon, 2012年02月06日 at 21:28 +0900, Jae-Joon Lee wrote:
>>> Thanks. Now I understand the situation.
>>>
>>> As far as I can see, marker="," is implemented as a rectangle path
>>> with width/height of 1 pixel, so this result in 2x2 pixel filled
>>> square.
>>> I tried to change the size of the rectangle, etc, to get a single
>>> pixel filled square, but did not get a satisfactory result.
>>> I think we need an Agg expert. I hope Mike or others take a look.
>>>
>>> Chris,
>>> if you do not get a response from others in this mailing list, I
>>> recommend you to open a new issue in our github page.
>>>
>>> Regards,
>>>
>>> -JJ
>>>
>>>
>>> On Mon, Feb 6, 2012 at 1:53 AM, Chris<pl...@gm...> wrote:
>>>> Thanks JJ.
>>>>
>>>> The problem seems not to be a size issue -- markersize has no effect
>>>> when use marker="," (pixel). I have also tried to turn off aa, and it
>>>> doesn't help either. I also tried different backends. The PNG output
>>>> from Agg and Cairo is slightly different: Agg's point has 4 solid
>>>> pixel, while Cairo's has 4 pixel with random shade.
>>>>
>>>> Postscript output has the same problem. The "pixel" in an EPS file
>>>> generated by mpl is significantly bigger than that from another
>>>> drawing program I used.
>>>>
>>>> The problem occurs in all my plotting scripts, e.g., this basic one:
>>>>
>>>> [CODE]
>>>> import numpy as np
>>>>
>>>> x=np.arange(100)
>>>> y=np.random.randn(100)
>>>>
>>>> ioff()
>>>> fig=gcf()
>>>> fig.clf()
>>>>
>>>> ax=fig.add_axes(0.15,0.1,0.8, 0.85)
>>>> ax.plot(x,y,"k,")
>>>>
>>>> ion()
>>>> fig.canvas.draw()
>>>> [/CODE]
>>>>
>>>> Here is how I identify the problem:
>>>> 1. use the above script to plot on screen
>>>> 2. savefig("plot.png")
>>>> 3. open plot.png in GIMP and check the pixel size.
>>>>
>>>> I also attached the two PNG files generated with Agg and Cairo backends.
>>>>
>>>>
>>>> On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee<lee...@gm...> wrote:
>>>>> How are you plotting your points.
>>>>>
>>>>> If you use *plot*, there is a *markersize* parameter.
>>>>> If you use *scatter*, the third argument controls the marker size.
>>>>>
>>>>> But you may actually complaining about other issues, e.g.,
>>>>> antialiasing, etc. So, if above are not your answer, please post a
>>>>> complete example and describe your problem in more detail.
>>>>>
>>>>> Regards,
>>>>>
>>>>> -JJ
>>>>>
>>>>>
>>>>> On Sat, Feb 4, 2012 at 2:15 PM, Chris<pl...@gm...> wrote:
>>>>>> I noticed this a few years back, but left it aside because most of the
>>>>>> time I can live with it. Recently I need to make a few plots
>>>>>> containing a few million points, and 4 pixels for a point is a
>>>>>> disaster. So my question is why the pixel marker size is set at 4
>>>>>> pixels? And is there anyway to change it to a single pixel?
>>>>>>
>>>>>> Thanks,
>>>>>> Chris
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Benjamin R. <ben...@ou...> - 2012年02月06日 19:12:12
On Mon, Feb 6, 2012 at 1:07 PM, Debashish Saha <sil...@gm...> wrote:
> what is the basic difference between the commands
> import pylab as *
> import matplotlib.pyplot as plt
>
>
This page should help you out. Let us know if you have any further
questions.
http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related
Ben Root
From: Debashish S. <sil...@gm...> - 2012年02月06日 19:07:59
what is the basic difference between the commands
import pylab as *
import matplotlib.pyplot as plt
From: Benjamin R. <ben...@ou...> - 2012年02月06日 18:08:01
On Mon, Feb 6, 2012 at 11:59 AM, David Craig <dcd...@gm...> wrote:
> I'm using a lenovo laptop with fedora 16. It has 2.9 GiB memory and 4
> intel core CPUs @ 2.3GHz each. Available disk space is 147.9GiB.
> numpy 1.6.0
> matplotlib 1.0.1
>
>
32-bit or 64-bit OS? Please use 'uname -a' to tell us, because you can
install a 32-bit OS on a 64-bit machine.
Ben Root
From: David C. <dcd...@gm...> - 2012年02月06日 18:00:10
I'm using a lenovo laptop with fedora 16. It has 2.9 GiB memory and 4 
intel core CPUs @ 2.3GHz each. Available disk space is 147.9GiB.
numpy 1.6.0
matplotlib 1.0.1
On 6 Feb 2012, at 10:29, Fabrice Silva wrote:
> On Sat, Feb 4, 2012 at 9:44 AM, Fabrice Silva <si...@lm...rs- 
> mrs.fr> wrote:
>> Le vendredi 03 février 2012 à 17:39 +0000, David Craig a 
>> écrit :
>>> sure how to get it to plot the outputs from specgram. I use
>>> specgram as follows,
>>> Pxx, freqs, bins, im = plt.specgram(......)
>>> what am I trying imshow??
>>
>>
>> plt.specgram computes the spectrogram and when calls 
>> imshow to display
>> the resulting array into an image
>>
>> Please tell the shape of Pxx, and try the following
>>
>> import numpy as np
>> import matplotlib.pyplot as plt
>> a = np.empty((12000, 14400), dtype=float)
>> plt.imshow(a)
>> plt.show()
>
> Le samedi 04 février 2012 à 10:30 +0000, David Craig a écrit :
>> Pxx has shape (6001, 1430) and when I tried the lines of code it 
>> returned the following memory error,
>>
>> Traceback (most recent call last):
>> File "/usr/lib/python2.7/site-packages/matplotlib/backends/ 
>> backend_gtk.py", line 394, in expose_event
>> self._render_figure(self._pixmap, w, h)
>> File "/usr/lib/python2.7/site-packages/matplotlib/backends/ 
>> backend_gtkagg.py", line 75, in _render_figure
>> FigureCanvasAgg.draw(self)
>> File "/usr/lib/python2.7/site-packages/matplotlib/backends/ 
>> backend_agg.py", line 394, in draw
>> self.figure.draw(self.renderer)
>> File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", 
>> line 55, in draw_wrapper
>> draw(artist, renderer, *args, **kwargs)
>> File "/usr/lib/python2.7/site-packages/matplotlib/figure.py", 
>> line 798, in draw
>> func(*args)
>> File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", 
>> line 55, in draw_wrapper
>> draw(artist, renderer, *args, **kwargs)
>> File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 
>> 1946, in draw
>> a.draw(renderer)
>> File "/usr/lib/python2.7/site-packages/matplotlib/artist.py", 
>> line 55, in draw_wrapper
>> draw(artist, renderer, *args, **kwargs)
>> File "/usr/lib/python2.7/site-packages/matplotlib/image.py", 
>> line 354, in draw
>> im = self.make_image(renderer.get_image_magnification())
>> File "/usr/lib/python2.7/site-packages/matplotlib/image.py", 
>> line 569, in make_image
>> transformed_viewLim)
>> File "/usr/lib/python2.7/site-packages/matplotlib/image.py", 
>> line 201, in _get_unsampled_image
>> x = self.to_rgba(self._A, self._alpha)
>> File "/usr/lib/python2.7/site-packages/matplotlib/cm.py", line 
>> 193, in to_rgba
>> x = self.norm(x)
>> File "/usr/lib/python2.7/site-packages/matplotlib/colors.py", 
>> line 802, in __call__
>> val = ma.asarray(value).astype(np.float)
>> File "/usr/lib/python2.7/site-packages/numpy/ma/core.py", line 
>> 2908, in astype
>> output = self._data.astype(newtype).view(type(self))
>> MemoryError
>
> Please, answer on the mailing list,
> It confirms that the troubles lie in the rendering of images. Could 
> you
> tell the versions of numpy and matplotlib you are using, and the
> characteristics of the computer you are working on ?
>
>
> ---------------------------------------------------------------------- 
> --------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft 
> developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, 
> MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Chris <pl...@gm...> - 2012年02月06日 17:58:31
JJ,
Thanks for the clarification. Now I understand why EPS outputs of
pixel plot from mpl is a few times bigger than those from SuperMongo.
I guess that mpl uses the square implementation for pixel so that it
would use the same method to handle all marker types. I will file an
issue report on git. Meanwhile, is there any easy workaround?
Jonathan,
Tom Robitaille's module does help reducing file size of postscript,
but by rasterize a scalable plot. It doesn't really help my problem
since the markers are still drawn with the same method as other
plotting methods.
Bests,
Chris
On Mon, Feb 6, 2012 at 4:28 AM, Jae-Joon Lee <lee...@gm...> wrote:
> Thanks. Now I understand the situation.
>
> As far as I can see, marker="," is implemented as a rectangle path
> with width/height of 1 pixel, so this result in 2x2 pixel filled
> square.
> I tried to change the size of the rectangle, etc, to get a single
> pixel filled square, but did not get a satisfactory result.
> I think we need an Agg expert. I hope Mike or others take a look.
>
> Chris,
> if you do not get a response from others in this mailing list, I
> recommend you to open a new issue in our github page.
>
> Regards,
>
> -JJ
>
On Mon, Feb 6, 2012 at 6:19 AM, Jonathan Slavin <js...@cf...> wrote:
> Chris,
>
> You might want to try a module written by Tom Robitaille (aka astrofrog)
> called rasterized_scatter. Look for it on github.
>
> Jon
>
> On Mon, 2012年02月06日 at 21:28 +0900, Jae-Joon Lee wrote:
>> Thanks. Now I understand the situation.
>>
>> As far as I can see, marker="," is implemented as a rectangle path
>> with width/height of 1 pixel, so this result in 2x2 pixel filled
>> square.
>> I tried to change the size of the rectangle, etc, to get a single
>> pixel filled square, but did not get a satisfactory result.
>> I think we need an Agg expert. I hope Mike or others take a look.
>>
>> Chris,
>> if you do not get a response from others in this mailing list, I
>> recommend you to open a new issue in our github page.
>>
>> Regards,
>>
>> -JJ
>>
>>
>> On Mon, Feb 6, 2012 at 1:53 AM, Chris <pl...@gm...> wrote:
>> > Thanks JJ.
>> >
>> > The problem seems not to be a size issue -- markersize has no effect
>> > when use marker="," (pixel). I have also tried to turn off aa, and it
>> > doesn't help either. I also tried different backends. The PNG output
>> > from Agg and Cairo is slightly different: Agg's point has 4 solid
>> > pixel, while Cairo's has 4 pixel with random shade.
>> >
>> > Postscript output has the same problem. The "pixel" in an EPS file
>> > generated by mpl is significantly bigger than that from another
>> > drawing program I used.
>> >
>> > The problem occurs in all my plotting scripts, e.g., this basic one:
>> >
>> > [CODE]
>> > import numpy as np
>> >
>> > x=np.arange(100)
>> > y=np.random.randn(100)
>> >
>> > ioff()
>> > fig=gcf()
>> > fig.clf()
>> >
>> > ax=fig.add_axes(0.15,0.1,0.8, 0.85)
>> > ax.plot(x,y,"k,")
>> >
>> > ion()
>> > fig.canvas.draw()
>> > [/CODE]
>> >
>> > Here is how I identify the problem:
>> > 1. use the above script to plot on screen
>> > 2. savefig("plot.png")
>> > 3. open plot.png in GIMP and check the pixel size.
>> >
>> > I also attached the two PNG files generated with Agg and Cairo backends.
>> >
>> >
>> > On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee <lee...@gm...> wrote:
>> >> How are you plotting your points.
>> >>
>> >> If you use *plot*, there is a *markersize* parameter.
>> >> If you use *scatter*, the third argument controls the marker size.
>> >>
>> >> But you may actually complaining about other issues, e.g.,
>> >> antialiasing, etc. So, if above are not your answer, please post a
>> >> complete example and describe your problem in more detail.
>> >>
>> >> Regards,
>> >>
>> >> -JJ
>> >>
>> >>
>> >> On Sat, Feb 4, 2012 at 2:15 PM, Chris <pl...@gm...> wrote:
>> >>> I noticed this a few years back, but left it aside because most of the
>> >>> time I can live with it. Recently I need to make a few plots
>> >>> containing a few million points, and 4 pixels for a point is a
>> >>> disaster. So my question is why the pixel marker size is set at 4
>> >>> pixels? And is there anyway to change it to a single pixel?
>> >>>
>> >>> Thanks,
>> >>> Chris
>
Hi
That was a very nice explanation of how autoscale works, thank you very
much :D
After now understanding how the function autoscale function works, I see
that this would be a major change in the code, as it would require the axes
to know all of the bounding boxes, and not only one of them.
As it, at least in my code, is easy to calculate the new limits on the
unset axis, I would not put this up as something that should be a feature.
Though I think the documentation for autoscale, section axis could be a bit
clearer and state that autoscaling only one axis autoscales that axis with
respect to everything plotted, even though xlim/ylim has been set.
Regards
Pål
On 6 February 2012 18:02, Benjamin Root <ben...@ou...> wrote:
>
>
> On Mon, Feb 6, 2012 at 4:47 AM, Pål Gunnar Ellingsen <pa...@gm...>wrote:
>
>> Hi
>>
>> I understand that it would be hard to implement, as it requires that all
>> the points are checked, which for a arbitrary plot is not easy.
>> Though is this not what is already done for the normal autoscale, or have
>> I misunderstood how the normal autoscale is done?
>>
>> I would like to have this as a new feature, as it would prove useful for
>> analysing graphs, especially in scientific research.
>>
>> Kind regards
>>
>> Pål
>>
>>
>>
> Pal,
>
> Normal autoscaling (when aspect is None, which is default) means to
> display all the data that has been plotted. This is possible because the
> plotting functions (which were given the data as input) updates the limits
> of the "known data bounding box" for the axes. This data is not stored
> except within each artist object, in their own form. It becomes difficult
> to then "re-query" that data in the general case. It isn't to say that it
> isn't possible to do, just that the architecture isn't set up to query
> subsets of collections.
>
> I hope this is clearer,
> Ben Root
>
>
On Mon, Feb 6, 2012 at 4:47 AM, Pål Gunnar Ellingsen <pa...@gm...>wrote:
> Hi
>
> I understand that it would be hard to implement, as it requires that all
> the points are checked, which for a arbitrary plot is not easy.
> Though is this not what is already done for the normal autoscale, or have
> I misunderstood how the normal autoscale is done?
>
> I would like to have this as a new feature, as it would prove useful for
> analysing graphs, especially in scientific research.
>
> Kind regards
>
> Pål
>
>
>
Pal,
Normal autoscaling (when aspect is None, which is default) means to display
all the data that has been plotted. This is possible because the plotting
functions (which were given the data as input) updates the limits of the
"known data bounding box" for the axes. This data is not stored except
within each artist object, in their own form. It becomes difficult to then
"re-query" that data in the general case. It isn't to say that it isn't
possible to do, just that the architecture isn't set up to query subsets of
collections.
I hope this is clearer,
Ben Root
From: Michael D. <md...@st...> - 2012年02月06日 15:34:28
I'm looking into the source of this bug now.
Mike
On 02/06/2012 09:19 AM, Jonathan Slavin wrote:
> Chris,
>
> You might want to try a module written by Tom Robitaille (aka astrofrog)
> called rasterized_scatter. Look for it on github.
>
> Jon
>
> On Mon, 2012年02月06日 at 21:28 +0900, Jae-Joon Lee wrote:
>> Thanks. Now I understand the situation.
>>
>> As far as I can see, marker="," is implemented as a rectangle path
>> with width/height of 1 pixel, so this result in 2x2 pixel filled
>> square.
>> I tried to change the size of the rectangle, etc, to get a single
>> pixel filled square, but did not get a satisfactory result.
>> I think we need an Agg expert. I hope Mike or others take a look.
>>
>> Chris,
>> if you do not get a response from others in this mailing list, I
>> recommend you to open a new issue in our github page.
>>
>> Regards,
>>
>> -JJ
>>
>>
>> On Mon, Feb 6, 2012 at 1:53 AM, Chris<pl...@gm...> wrote:
>>> Thanks JJ.
>>>
>>> The problem seems not to be a size issue -- markersize has no effect
>>> when use marker="," (pixel). I have also tried to turn off aa, and it
>>> doesn't help either. I also tried different backends. The PNG output
>>> from Agg and Cairo is slightly different: Agg's point has 4 solid
>>> pixel, while Cairo's has 4 pixel with random shade.
>>>
>>> Postscript output has the same problem. The "pixel" in an EPS file
>>> generated by mpl is significantly bigger than that from another
>>> drawing program I used.
>>>
>>> The problem occurs in all my plotting scripts, e.g., this basic one:
>>>
>>> [CODE]
>>> import numpy as np
>>>
>>> x=np.arange(100)
>>> y=np.random.randn(100)
>>>
>>> ioff()
>>> fig=gcf()
>>> fig.clf()
>>>
>>> ax=fig.add_axes(0.15,0.1,0.8, 0.85)
>>> ax.plot(x,y,"k,")
>>>
>>> ion()
>>> fig.canvas.draw()
>>> [/CODE]
>>>
>>> Here is how I identify the problem:
>>> 1. use the above script to plot on screen
>>> 2. savefig("plot.png")
>>> 3. open plot.png in GIMP and check the pixel size.
>>>
>>> I also attached the two PNG files generated with Agg and Cairo backends.
>>>
>>>
>>> On Sun, Feb 5, 2012 at 6:45 AM, Jae-Joon Lee<lee...@gm...> wrote:
>>>> How are you plotting your points.
>>>>
>>>> If you use *plot*, there is a *markersize* parameter.
>>>> If you use *scatter*, the third argument controls the marker size.
>>>>
>>>> But you may actually complaining about other issues, e.g.,
>>>> antialiasing, etc. So, if above are not your answer, please post a
>>>> complete example and describe your problem in more detail.
>>>>
>>>> Regards,
>>>>
>>>> -JJ
>>>>
>>>>
>>>> On Sat, Feb 4, 2012 at 2:15 PM, Chris<pl...@gm...> wrote:
>>>>> I noticed this a few years back, but left it aside because most of the
>>>>> time I can live with it. Recently I need to make a few plots
>>>>> containing a few million points, and 4 pixels for a point is a
>>>>> disaster. So my question is why the pixel marker size is set at 4
>>>>> pixels? And is there anyway to change it to a single pixel?
>>>>>
>>>>> Thanks,
>>>>> Chris
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just 99ドル.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
6 messages has been excluded from this view by a project administrator.

Showing results of 408

<< < 1 .. 12 13 14 15 16 17 > >> (Page 14 of 17)
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 によって変換されたページ (->オリジナル) /