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

Showing 14 results of 14

From: Michael D. <md...@st...> - 2007年08月06日 21:03:22
There is now experimental support for custom fonts in math mode.
You'll need to set "mathtext.use_cm" to False, and then set up a mapping 
from each of the TeX font names to the name of your desired font.
It is assumed that the fonts are Unicode fonts -- it will use the same 
font for both Latin and Greek characters. If your font doesn't have 
Greek characters, it will (optionally) fall back on the Computer Modern 
fonts. There isn't (at present) a way to fall back to a Greek-only 
font. (There would, IMHO, have to be a compelling reason to add that 
functionality, since there are too many font options to test already ;)
Here's an excerpt from matplotlib.template:
# The following settings allow you to select the fonts in math mode.
# They map from a TeX font name to a 3-tuple of the form:
# (family, weight, style)
# These settings are only used if mathtext.use_cm is False, otherwise, the
# Bakoma TeX Computer Modern fonts are used.
#mathtext.cal : (['cursive'], 'normal', 'normal')
#mathtext.rm : (['serif'], 'normal', 'normal')
#mathtext.tt : (['monospace'], 'normal', 'normal')
#mathtext.it : (['serif'], 'normal', 'oblique')
#mathtext.bf : (['serif'], 'bold', 'normal')
#mathtext.sf : (['sans-serif'], 'normal', 'normal')
#mathtext.use_cm : True
#mathtext.fallback_to_cm : True # When True, use symbols from the 
Computer Modern
			 # fonts when a symbol can not be found in one of
				 # the user-specified math fonts.
Rob Hetland wrote:
> However, I often just want to put powers on units -- e.g., m^3 s^{-1}, 
> and serifed fonts look terrible as superscripts for sans fonts.
Agreed.
> Perhaps there is another way to get what I want?
Try the above, and let me know how it goes...
> Also, the main problem I find when mixing CM symbols (e.g., \epsilon) 
> with other fonts is that the CM fonts seem small. Perhaps there is a 
> way to jack up the symbol size to that it matches the non-CM fonts in a 
> more reasonable way?
If the Unicode font has both Latin and Greek characters in it, those 
characters should play well together. More generally, though, I agree, 
and one might run into that problem using some of the more obscure math 
operators. Perhaps scaling one or the other font to get the x-heights 
to match might work. I'll have to look into that further...
Thanks for spurring me on to get this custom font stuff together.
Cheers,
Mike
From: Angus M. <am...@gm...> - 2007年08月06日 20:13:19
On 07/08/07, fred <fr...@gm...> wrote:
> Angus McMorland a =E9crit :
>
> > Since all sorts of data can be displayed in am mpl window (e.g. a
> > plot, a contour...) you have to tell it how to access the correct
> > scalar value to display. You could do this with the
> > motion_notify_event. Register it during init, something like:
> >
> > self.canvas.mpl_connect('motion_notify_event', self.mouse_move_callback=
)
> >
> > then in mouse_move_callback:
> >
> > def mouse_move_callback(self, evt):
> > xpos, ypos =3D evt.xdata, evt.ydata
> > val =3D self.data[numpy.floor(xpos), numpy.floor(ypos)]
> > status_str =3D "x: %4.2f y: %4.2f I:%4.2f" \
> > % (xpos, ypos, val)
> > self.SetStatusText(status_str)
> >
> > where data is your image variable. This works in a wx.Frame object,
> > which has a SetStatusString method for displaying the values. I'm sure
> > you could find an equivalent in your traits app.
> >
> >
> Thanks, I'll look at this asap (as I got other stuff "on fire").
>
> BTW, I can't ever get (in fact, I don't know how) working
> the coords to be displayed in my traits app.
> I guess this is more related to traits, not to mpl.
For what it's worth, mpl embedded in wx also _requires_ the use of
motion_notify_event to get co-ordinates to display. It doesn't happen
by default except in stand-alone mpl as far as I can tell.
> But the "mpl embedded in traits app guru" is on holydays for now.
>
> Let's wait...
>
> Cheers,
>
> --
> http://scipy.org/FredericPetit
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--=20
AJC McMorland, PhD Student
Physiology, University of Auckland
From: Rob H. <he...@ta...> - 2007年08月06日 20:03:46
> For example, the freefonts don't have a very complete math symbol 
> set at all. Falling back on the Computer Modern fonts for just 
> those symbols would work, but won't look very nice. That said, a 
> lot of users can probably do without those extended symbols 
> altogether.
You say that CM fonts/symbols look bad mixed with other fonts -- that 
is also my experience from years of LaTeXing...
However, I often just want to put powers on units -- e.g., m^3 s^ 
{-1}, and serifed fonts look terrible as superscripts for sans fonts.
Perhaps there is another way to get what I want?
Also, the main problem I find when mixing CM symbols (e.g., \epsilon) 
with other fonts is that the CM fonts seem small. Perhaps there is a 
way to jack up the symbol size to that it matches the non-CM fonts in 
a more reasonable way?
-Rob
----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331
From: Michael D. <md...@st...> - 2007年08月06日 19:16:24
I believe the rcParams you're referring to actually affect the (now 
deprecated) mathtext2, which explains why they're having no effect ;) 
Sorry about that.
These will soon be replaced with a new way to handle custom Unicode 
fonts, that is mostly working, but may not produce the best results. 
When typesetting math, symbols are pulled in from a number of fonts, and 
it looks best when all symbols are designed to match.
For example, the freefonts don't have a very complete math symbol set at 
all. Falling back on the Computer Modern fonts for just those symbols 
would work, but won't look very nice. That said, a lot of users can 
probably do without those extended symbols altogether.
The other nice thing that the Computer Modern fonts have is multiple 
sizes of many of the delimiters. For instance, as the '[' gets taller, 
it doesn't get wider as well.
In any case, once I have an interface available for fonts to be replaced 
by the end user, I'll let you know and you can decide for yourself. I 
think I'm probably judging that option harshly based on the complete set 
of features available, not on a common subset that matters most.
Cheers,
Mike
Rob Hetland wrote:
> I would like to use sans-serif math fonts in mathtext (inspired by 
> Tufte -- most of his examples use sans fonts).
> 
> Apparently there are rcParams options to be set, however, I keep 
> getting computer modern math fonts. I would like to use the 
> FreeSansOblique for the math italic font. How do I do this?
> 
> -Rob
> 
> 
> 
> p.s. I *love* the new mathtext -- nice work.
> 
> 
> p.s.s. For those who don't pay attention to fonts, the Free font 
> sans series seems to be a pretty faithful reproduction of Helvetica. 
> I have renewed my enthusiasm for Helvetica after reading this article:
> 
> http://www.ms-studio.com/articles.html
> 
> 
> ----
> Rob Hetland, Associate Professor
> Dept. of Oceanography, Texas A&M University
> http://pong.tamu.edu/~rob
> phone: 979-458-0096, fax: 979-845-6331
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Rob H. <he...@ta...> - 2007年08月06日 18:14:25
I would like to use sans-serif math fonts in mathtext (inspired by 
Tufte -- most of his examples use sans fonts).
Apparently there are rcParams options to be set, however, I keep 
getting computer modern math fonts. I would like to use the 
FreeSansOblique for the math italic font. How do I do this?
-Rob
p.s. I *love* the new mathtext -- nice work.
p.s.s. For those who don't pay attention to fonts, the Free font 
sans series seems to be a pretty faithful reproduction of Helvetica. 
I have renewed my enthusiasm for Helvetica after reading this article:
http://www.ms-studio.com/articles.html
----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331
From: <jk...@ik...> - 2007年08月06日 18:07:49
George LeCompte <ge...@le...> writes:
> The contours labels show 3 zeros beyond the decimal point. Is it
> possible to force these labels to integers? If so how? If not why
> not?
clabel(CS, inline=1, fontsize=10, fmt='%3.0f')
> Is there a way to browse previous postings to matplotlib-users
> without looking month by month? For example can I bring up all
> postings regarding 'contour'?
This was discussed recently:
http://thread.gmane.org/gmane.comp.python.matplotlib.general/9915/focus=9917
You can search the list on at least sourceforge.net, gmane.org, and
mail-archive.com:
http://sourceforge.net/search/?ml_name=matplotlib-users&type_of_search=mlists&group_id=80706&words=contour
http://search.gmane.org/?query=contour&group=gmane.comp.python.matplotlib.general
http://www.mail-archive.com/search?q=contour&l=matplotlib-users%40lists.sourceforge.net
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年08月06日 17:58:44
"Zelakiewicz, Scott (GE, Research)"
<zel...@cr...> writes:
> I get one contour line as expected, but instead of printing the contour
> level (50) I would like to print a simple string like "Some String." I
> tried using the fmt option of clabel, but it requires a way to stuff in
> the level value (ie. fmt="Some String %f"). Is it possible to use a
> simple string for these labels?
I don't know if there is a recommended way, but here is a quick hack:
class FormatFaker(object):
 def __init__(self, str): self.str = str
 def __mod__(self, stuff): return self.str
A=arange(100).reshape(10,10)
CS=contour(A,[50,])
CS.clabel(fmt=FormatFaker('Some String'))
show()
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: George L. <ge...@le...> - 2007年08月06日 15:54:40
The attached MyContour.py generates ContourDemo.png (also attached).
My problem:
 The contours labels show 3 zeros beyond the decimal point. Is it
 possible to force these labels to integers? If so how? If not why not?
Ps.
 Is there a way to browse previous postings to matplotlib-users 
without looking month by month? For example can I bring up all postings 
regarding 'contour'?
thanks,
george
From: Zelakiewicz, S. (G. Research) <zel...@cr...> - 2007年08月06日 14:55:31
Hi,
I am trying to make a contour plot using custom labels that consist only
of text strings but can not figure it out. For example, if I do the
following:
A=3Darange(100)
A=3DA.reshape(10,10)
CS=3Dcontour(A,[50,])
clabel(CS)
I get one contour line as expected, but instead of printing the contour
level (50) I would like to print a simple string like "Some String." I
tried using the fmt option of clabel, but it requires a way to stuff in
the level value (ie. fmt=3D"Some String %f"). Is it possible to use a
simple string for these labels?
Thanks,
Scott.
From: Alexander B. <ale...@gm...> - 2007年08月06日 14:43:47
Hi all,
 I'm trying to display the histograms of lists of 2D vectors together with
their error ellipses in a 3D plot.
Plotting the histograms as 3D scatterplots is easy using
matplotlib.axes3d.Axes3D( ).scatter3D( x, y, h ),
but how do I draw the error ellipse in the ( x, y ) plane. I know how to
create a matplotlib.patches.Ellipse
object, but I'm pretty clueless on how to integrate it into the figure. Any
help?
-- 
Alex Borghgraef
From: fred <fr...@gm...> - 2007年08月06日 13:49:27
Angus McMorland a écrit :
> Since all sorts of data can be displayed in am mpl window (e.g. a
> plot, a contour...) you have to tell it how to access the correct
> scalar value to display. You could do this with the
> motion_notify_event. Register it during init, something like:
>
> self.canvas.mpl_connect('motion_notify_event', self.mouse_move_callback)
>
> then in mouse_move_callback:
>
> def mouse_move_callback(self, evt):
> xpos, ypos = evt.xdata, evt.ydata
> val = self.data[numpy.floor(xpos), numpy.floor(ypos)]
> status_str = "x: %4.2f y: %4.2f I:%4.2f" \
> % (xpos, ypos, val)
> self.SetStatusText(status_str)
>
> where data is your image variable. This works in a wx.Frame object,
> which has a SetStatusString method for displaying the values. I'm sure
> you could find an equivalent in your traits app.
>
> 
Thanks, I'll look at this asap (as I got other stuff "on fire").
BTW, I can't ever get (in fact, I don't know how) working
the coords to be displayed in my traits app.
I guess this is more related to traits, not to mpl.
But the "mpl embedded in traits app guru" is on holydays for now.
Let's wait...
Cheers,
-- 
http://scipy.org/FredericPetit
From: John H. <jd...@gm...> - 2007年08月06日 13:34:58
On 8/6/07, Michael Droettboom <md...@st...> wrote:
> from setupext import get_win32_compiler
> if sys.platform == 'win32' and get_win32_compiler() == 'mingw32':
> for module in ext_modules:
> module.libraries.append("msvcrt")
That message in setupext.py:
 NOTE, if you are building on python24 on win32, see
 http://mail.python.org/pipermail/python-list/2004-December/254826.html
refers to a patch for distutils to work around that bug. It now
appears this link is stale. Your approach is better anyway, because
it doesn't require patching distutils. I had assumed that because you
guys were following the build instructions closely, that this *was
not* the source of your problems. But it looks like the same bug, or
at least a closely related one. Haven't been able to find an active
link for that post, but your approach probably obviates it anyway.
From: Charlie M. <cw...@gm...> - 2007年08月06日 13:03:52
I'll give the build a try on windows tonight using my usual methods.
- Charlie
On 8/6/07, Michael Droettboom <md...@st...> wrote:
> william ratcliff wrote:
> > No, with whatever is in the current version of svn, it now works on the
> > intel quad as well. Thanks!
>
> That's great news! While it's great to hear that it's working, it would
> be even better to track down the cause of the failure, if possible.
>
> Do you mean the current version of SVN of numpy or matplotlib? It
> doesn't like there were any commits to matplotlib over the weekend.
>
> Do you happen to know what SVN revision was breaking before you updated
> and everything worked? When you finally updated and things worked, did
> you clean the build directory by any chance? Python distutils doesn't
> always track dependencies correctly and rebuild enough stuff, which can
> sometimes be the cause of problems.
>
> > I just tried following Michael's build
> > instructions (incidentally, could his last additions to setup.py be
> > checked in to svn, along with a profile25.bat file?)
>
> I was wary of committing that change until it had been reviewed by
> someone else with more mingw32 experience. It worked for me, but it has
> the feel of something slightly hackish...
>
> For review, in case some other Windows guys are listening, I adding the
> following right before the final "distrib = setup(..." in setup.py:
>
> from setupext import get_win32_compiler
> if sys.platform == 'win32' and get_win32_compiler() == 'mingw32':
> for module in ext_modules:
> module.libraries.append("msvcrt")
>
> As for profile25.bat, I can't find it in SVN. Maybe whoever is
> responsible for win32_static.tar.gz needs to do it. Not sure...
>
> Cheers,
> Mike
>
From: Michael D. <md...@st...> - 2007年08月06日 12:24:06
william ratcliff wrote:
 > No, with whatever is in the current version of svn, it now works on the
 > intel quad as well. Thanks!
That's great news! While it's great to hear that it's working, it would 
be even better to track down the cause of the failure, if possible.
Do you mean the current version of SVN of numpy or matplotlib? It 
doesn't like there were any commits to matplotlib over the weekend.
Do you happen to know what SVN revision was breaking before you updated 
and everything worked? When you finally updated and things worked, did 
you clean the build directory by any chance? Python distutils doesn't 
always track dependencies correctly and rebuild enough stuff, which can 
sometimes be the cause of problems.
> I just tried following Michael's build
> instructions (incidentally, could his last additions to setup.py be
> checked in to svn, along with a profile25.bat file?)
I was wary of committing that change until it had been reviewed by 
someone else with more mingw32 experience. It worked for me, but it has 
the feel of something slightly hackish...
For review, in case some other Windows guys are listening, I adding the 
following right before the final "distrib = setup(..." in setup.py:
 from setupext import get_win32_compiler
 if sys.platform == 'win32' and get_win32_compiler() == 'mingw32':
 for module in ext_modules:
 module.libraries.append("msvcrt")
As for profile25.bat, I can't find it in SVN. Maybe whoever is 
responsible for win32_static.tar.gz needs to do it. Not sure...
Cheers,
Mike
1 message has been excluded from this view by a project administrator.

Showing 14 results of 14

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