dmwm / cmssh

Interactive shell for CMS experiment
http://cms.cern.ch/
7 stars 2 forks source link

turn off text.usetex #13

Closed neggert closed 12 years ago

neggert commented 12 years ago

Hi, I get these warnings when I start cmssh:

/Users/nic/cms/soft/CMSSW/osx106_amd64_gcc421/external/py2-matplotlib/1.0.1-cms3/lib/python2.6/site-packages/matplotlib/__init__.py:397: UserWarning: matplotlibrc text.usetex option can not be used unless TeX-3.1415 or later is installed on your system
  'installed on your system') % tex_req)
/Users/nic/cms/soft/CMSSW/osx106_amd64_gcc421/external/py2-matplotlib/1.0.1-cms3/lib/python2.6/site-packages/matplotlib/__init__.py:403: UserWarning: matplotlibrc text.usetex can not be used with *Agg backend unless dvipng-1.5 or later is installed on your system
  warnings.warn( 'matplotlibrc text.usetex can not be used with *Agg '
/Users/nic/cms/soft/CMSSW/osx106_amd64_gcc421/external/py2-matplotlib/1.0.1-cms3/lib/python2.6/site-packages/matplotlib/__init__.py:417: UserWarning: matplotlibrc text.usetex can not be used unless ghostscript-7.07 or later is installed on your system
  'installed on your system') % gs_req)

This happens because I have my matplotlibrc set up to use latex. You might consider forcing the system to use a matplotlibrc that you have written rather than picking up the one in the home directory to prevent problems like this. I've written a matplotlibrc that looks somewhat like the official CMS plot style, if you'd like me to send it to you.

vkuznet commented 12 years ago

Yes, please attach your rc file. I don't mind to stick it in.

neggert commented 12 years ago

https://gist.github.com/2406185

vkuznet commented 12 years ago

Ok, it is on a master branch.

neggert commented 12 years ago

I'm still getting the same errors. Seems like it's still picking up the matplotlibrc in my home directory.

vkuznet commented 12 years ago

Nic, I don't know much the matplotlib, but I did add rc file into install/lib/python-2.6/site-packages/matplotlib/mpl-data area. Please check. We need to find a way to tell matplotlib to pick up the one from our install area instead of HOME. I bet that it does reverse, i.e. it prefer the one from home area.

neggert commented 12 years ago

I'll see if I can figure out how to tell matplotlib how to use a different rc file.

On Wed, Apr 18, 2012 at 2:13 PM, Valentin Kuznetsov reply@reply.github.com wrote:

Nic, I don't know much the matplotlib, but I did add rc file into install/lib/python-2.6/site-packages/matplotlib/mpl-data area. Please check. We need to find a way to tell matplotlib to pick up the one from our install area instead of HOME. I bet that it does reverse, i.e. it prefer the one from home area.


Reply to this email directly or view it on GitHub: https://github.com/vkuznet/cmssh/issues/13#issuecomment-5204997

neggert commented 12 years ago

It looks like this is not possible. See http://matplotlib.sourceforge.net/users/customizing.html

vkuznet commented 12 years ago

Wrong statement :), it is possible, you need to properly set MATPLOTLIBRC, add to your soft/setup.sh the following line (I'll include it in cmssh installer)

export MATPLOTLIBRC=$CMSSH_ROOT/install/lib/python2.6/site-packages/matplotlib/mpl-data

Then cmssh will pick up proper rc file. I just verified this as following

cms-sh|1> matplotlib.matplotlib_fname() Out[1]: '/Users/vk/CMS/test_cmssh2/soft/install/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc'

But the one you gave me the file which has some problem, could you please investigate and create proper rc file. Here is a mesage I got

Bad key "text.markup" on line 162 in /Users/vk/CMS/test_cmssh2/soft/install/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc. You probably need to get an updated matplotlibrc file from http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source distribution /Users/vk/CMS/test_cmssh2/soft/CMSSW/osx106_amd64_gcc421/external/py2-matplotlib/1.0.1-cms3/lib/python2.6/site-packages/matplotlib/init.py:734: UserWarning: Bad val "mathpazo" on line #191 "mathtext.default : mathpazo # The default font to use for math. " in file "/Users/vk/CMS/test_cmssh2/soft/install/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc" Unrecognized default string "mathpazo": valid strings are ['bf', 'bb', 'default', 'tt', 'circled', 'frak', 'it', 'regular', 'cal', 'rm', 'sf', 'scr'] "%s"\n\t%s' % (val, cnt, line, fname, msg))

vkuznet commented 12 years ago

I disabled text.markup and used default font for mathtext.default option, see d8f90a0. The rc file should be very conservative and work across multiple version of matplotlib (the one which is installed by default).

neggert commented 12 years ago

Ah, yes. Sorry about that. That's the default CMS font for math, but it's probably not installed on all systems. Using default for math text.default should solve the problem.

On Wed, Apr 18, 2012 at 3:57 PM, Valentin Kuznetsov reply@reply.github.com wrote:

I disabled text.markup and used default font for mathtext.default option, see d8f90a0. The rc file should be very conservative and work across multiple version of matplotlib (the one which is installed by default).


Reply to this email directly or view it on GitHub: https://github.com/vkuznet/cmssh/issues/13#issuecomment-5207220