SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Nicolas P. <nic...@gm...> - 2009年05月28日 16:04:36
Hi,
is there any way to use Computer Modern in any text in matplotlib ?
In http://matplotlib.sourceforge.net/users/customizing.html, I read the 
following :
#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive
#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy
#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
So, Computer Modern is not listed there.
However, Computer Modern is used in mathtext, so I suppose there is a 
way to use it also in plain text, but I can't figure it...
I tried :
/mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
but it did not work.
Thanks a lot,
Nicolas P.
From: Michael D. <md...@st...> - 2009年05月28日 17:47:29
The name of the Computer Modern Roman font that ships with matplotlib is 
"cmr10", so
 mpl.rc('font', family = 'serif', serif = 'cmr10')
should work.
Mike
Nicolas Pourcelot wrote:
> Hi,
>
> is there any way to use Computer Modern in any text in matplotlib ?
>
> In http://matplotlib.sourceforge.net/users/customizing.html, I read 
> the following :
>
> #font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
> #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
> #font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive
> #font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy
> #font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
> 
> So, Computer Modern is not listed there.
>
> However, Computer Modern is used in mathtext, so I suppose there is a 
> way to use it also in plain text, but I can't figure it...
>
> I tried :
> /mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
> but it did not work.
>
> Thanks a lot,
>
> Nicolas P.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Nicolas P. <nic...@gm...> - 2009年05月29日 20:10:54
Thanks, it works well.
However, I forgot that computer modern does not include accented 
characters (unlike latin modern), so I eventually used Stix :
mpl.rc('font', family = 'serif', serif = 'STIXGeneral')
By the way, is there any way to use Stix for sans-serif as well, or even 
cursive and monospace ? I don't know how to do that, since Stix seems to 
contain all of them in a single file (STIXGeneral.ttf) ?
Nicolas
Michael Droettboom a écrit :
> The name of the Computer Modern Roman font that ships with matplotlib 
> is "cmr10", so
>
> mpl.rc('font', family = 'serif', serif = 'cmr10')
>
> should work.
>
> Mike
>
> Nicolas Pourcelot wrote:
>> Hi,
>>
>> is there any way to use Computer Modern in any text in matplotlib ?
>>
>> In http://matplotlib.sourceforge.net/users/customizing.html, I read 
>> the following :
>>
>> #font.serif : Bitstream Vera Serif, New Century Schoolbook, 
>> Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 
>> L, Times New Roman, Times, Palatino, Charter, serif
>> #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, 
>> Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
>> #font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, 
>> cursive
>> #font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, 
>> Western, fantasy
>> #font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus 
>> Mono L, Courier New, Courier, Fixed, Terminal, monospace
>> So, Computer Modern is not listed there.
>>
>> However, Computer Modern is used in mathtext, so I suppose there is a 
>> way to use it also in plain text, but I can't figure it...
>>
>> I tried :
>> /mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
>> but it did not work.
>>
>> Thanks a lot,
>>
>> Nicolas P.
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------ 
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>> is a gathering of tech-side developers & brand creativity 
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>> Barbarian Group, R/GA, & Big Spaceship. 
>> http://p.sf.net/sfu/creativitycat-com 
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>
From: Michael D. <md...@st...> - 2009年06月01日 12:51:07
There's no easy way to do what you ask. You can, however, use math mode 
to get to those characters in STIX. For example, set mathtext.fontset 
to "stix" and then:
 r'$\mathcal{Caligraphic} \mathtt{Monospace}$'
Mike
Nicolas Pourcelot wrote:
> Thanks, it works well.
>
> However, I forgot that computer modern does not include accented 
> characters (unlike latin modern), so I eventually used Stix :
>
> mpl.rc('font', family = 'serif', serif = 'STIXGeneral')
>
> By the way, is there any way to use Stix for sans-serif as well, or 
> even cursive and monospace ? I don't know how to do that, since Stix 
> seems to contain all of them in a single file (STIXGeneral.ttf) ?
>
> Nicolas
>
>
> Michael Droettboom a écrit :
>> The name of the Computer Modern Roman font that ships with matplotlib 
>> is "cmr10", so
>>
>> mpl.rc('font', family = 'serif', serif = 'cmr10')
>>
>> should work.
>>
>> Mike
>>
>> Nicolas Pourcelot wrote:
>>> Hi,
>>>
>>> is there any way to use Computer Modern in any text in matplotlib ?
>>>
>>> In http://matplotlib.sourceforge.net/users/customizing.html, I read 
>>> the following :
>>>
>>> #font.serif : Bitstream Vera Serif, New Century Schoolbook, 
>>> Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 
>>> L, Times New Roman, Times, Palatino, Charter, serif
>>> #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, 
>>> Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
>>> #font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, 
>>> cursive
>>> #font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, 
>>> Western, fantasy
>>> #font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus 
>>> Mono L, Courier New, Courier, Fixed, Terminal, monospace
>>> So, Computer Modern is not listed there.
>>>
>>> However, Computer Modern is used in mathtext, so I suppose there is 
>>> a way to use it also in plain text, but I can't figure it...
>>>
>>> I tried :
>>> /mpl.rc('font', family = 'serif', serif = 'computer modern roman')/
>>> but it did not work.
>>>
>>> Thanks a lot,
>>>
>>> Nicolas P.
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ------------------------------------------------------------------------------ 
>>>
>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
>>> is a gathering of tech-side developers & brand creativity 
>>> professionals. Meet
>>> the minds behind Google Creative Lab, Visual Complexity, Processing, 
>>> & iPhoneDevCamp as they present alongside digital heavyweights like 
>>> Barbarian Group, R/GA, & Big Spaceship. 
>>> http://p.sf.net/sfu/creativitycat-com 
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
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 によって変換されたページ (->オリジナル) /