Hi,

I am preparing figures with the following matplotlib preamble:

plt.rc('font', **{'family':'serif', 'serif':['Computer Modern Roman'],
                  'monospace':['Computer Modern Typewriter']})
params = {'backend': 'ps',
          'text.latex.preamble': [r"\usepackage{upgreek}",
                                  r"\usepackage[nice]{units}"],
          'axes.labelsize': 12,
          'text.fontsize': 12,
          'legend.fontsize': 8,
          'xtick.labelsize': 10,
          'ytick.labelsize': 10,
          'text.usetex': True,
          'figure.figsize': fig_size,
          'axes.unicode_minus': True}
plt.rcParams.update(params)


But when using subscript and superscript in math mode the sizes end up
different than in my LaTeX document (my .cls is using "book" as base class).

Attached are two screenshots of it rendered from matplotlib and from
Latex (sorry for the different sizes). The "mean" is clearly of
different size in relation to the "d".


Is there an option to specify a .cls file in rcParams that should be
used for rendering?
I tried:
text.latex.preamble': [r"\documentclass[twoside]{mycls}",
                                  r"\usepackage{upgreek}",
                                  r"\usepackage[nice]{units}"],
but then I get the error:
! LaTeX Error: Two \documentclass or \documentstyle commands.

How to overwrite default matplotlib one? my matplotlibrc has a commented
preamble.



See also my question on tex.stackexchange.com:
http://tex.stackexchange.com/questions/70400/subscript-size-different-in-latex-and-matplotlib



Many thanks

<<attachment: LaTeX_latex_subscript.png>>

<<attachment: MPL_latex_subscript.png>>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to