# How to use STIX fonts in matplotlib plots?

Breaking news from the MathJax site:

The *SVG output processor* is new in MathJax version 2.0, and it uses Scalable
Vector Graphics to render the mathematics on the page.

Mike: Could we use this to finally render all text in STIX *without* using
an external TeX installation? This would be fantastic!

David

Not everything that views SVG is a web browser with Javascript
support, so doing so would break using the SVG files in Inkscape and
Adobe Illustrator, for example. I think that’s kind of a
non-starter, unfortunately.
You already can render all text in STIX without an external TeX
installation. That’s the purpose of the mathtext support in
matplotlib. I agree it has the one wart that the default font also
needs to be set when using stix for the math, but beyond that, it
Cheers,
Mike

···

On 07/21/2013 04:12 AM, David P.
Sanders wrote:

Breaking news from the MathJax site:

The ** SVG
output processor** is
new in MathJax version 2.0, and it uses Scalable
Vector Graphics to
render the mathematics on the page.

        Mike:


Could we use this to finally render all text in STIX
without using an external TeX installation? This
would be fantastic!

David

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!

_______________________________________________
Matplotlib-devel mailing list


Mike:
For some reason I didn’t see your posts until now, apologies.

In fact, STIX is not supposed to “blend with” Times; rather, STIX replaces Times wholesale – i.e. they have redesigned the whole character set. Thus labels (ticks, arbitrary text etc.) should also use STIX, even if they don’t use math.

I finally found the correct rcParams to use to achieve this:

from matplotlib import rcParams

rcParams[“font.family”] = “STIXGeneral”

rcParams[“mathtext.fontset”] = “stix”

It would certainly be nice if this could be done with a single setting.

It seems to me that given that STIX is already distributed with Matplotlib, this could be a good new default to replace Bitstream Vera Sans.

···

On Mon, Jul 22, 2013 at 8:46 AM, Michael Droettboom <mdroe@…31…> wrote:

  On 07/21/2013 04:12 AM, David P.


Sanders wrote:

Not everything that views SVG is a web browser with Javascript


support, so doing so would break using the SVG files in Inkscape and
Adobe Illustrator, for example. I think that’s kind of a
non-starter, unfortunately.

You already can render all text in STIX without an external TeX


installation. That’s the purpose of the mathtext support in
matplotlib. I agree it has the one wart that the default font also
needs to be set when using stix for the math, but beyond that, it

Cheers,

Mike

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
[https://lists.sourceforge.net/lists/listinfo/matplotlib-devel](https://lists.sourceforge.net/lists/listinfo/matplotlib-devel)


See everything from the browser to the database with AppDynamics

Get end-to-end visibility with application monitoring from AppDynamics

Isolate bottlenecks and diagnose root cause in seconds.

Start your free trial of AppDynamics Pro today!

Matplotlib-devel mailing list

Matplotlib-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Dr. David P. Sanders

Profesor Titular “A” / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@…552…1147…
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física
Tel.: +52 55 5622 4965

Breaking news from the MathJax site:

The ** SVG
output processor** is
new in MathJax version 2.0, and it uses Scalable
Vector Graphics to
render the mathematics on the page.

        Mike:


Could we use this to finally render all text in STIX
without using an external TeX installation? This
would be fantastic!

David