Location matplotlibrc file on my Mac

From: Tony S Yu [mailto:tonyyu@…1165…]>

Hi Paul,

I think your matplotlibrc file should be put in:
/Users/paul/.matplotlib

-Tony

Thanks Tony, I'll give that a shot. Shouldn't keeping it in my current working directory work as well? One of the great things about using the matplotlibrc file on my Windows machine is that I can keep different files for different projects.

(Paul, I hope you don't mind if I bring this bump this back to the list).

Apparently I skimmed your original email and didn't see that you tried putting the file in your working directory. That should work. (My original response is still appropriate for a global rc file.)

As suggested on the mpl website (specifically: http://matplotlib.sourceforge.net/users/customizing.html), you can try printing out the path of the rc file being used by adding the following to your script:

>>> import matplotlib
>>> print matplotlib.matplotlib_fname()

Also, you may want to check that the working directory is where you think it is. For example, if you run a script from the terminal as:

$ python ~/path/to/file.py

Your working directory is '~' and not '~/path/to/'---so matplotlibrc file located in the same directory as file.py would not be in the working directory.

Otherwise, I have no idea why the matplotlibrc is not being found in the working directory.

Best,
-Tony

···

On Nov 3, 2009, at 3:08 PM, <PHobson@...2850...> <PHobson@...2850... > wrote:

-----Original Message-----

> From: Tony S Yu [mailto:tonyyu@…1165…]>
>> Hi Paul,
>>
>> I think your matplotlibrc file should be put in:
>> /Users/paul/.matplotlib
>>
>> -Tony
>
> Thanks Tony, I'll give that a shot. Shouldn't keeping it in my
> current working directory work as well? One of the great things
> about using the matplotlibrc file on my Windows machine is that I
> can keep different files for different projects.

(Paul, I hope you don't mind if I bring this bump this back to the
list).

Not at all. I meant to reply to the whole list last time :slight_smile:

Apparently I skimmed your original email and didn't see that you tried
putting the file in your working directory. That should work. (My
original response is still appropriate for a global rc file.)

As suggested on the mpl website (specifically:
http://matplotlib.sourceforge.net/users/customizing.html
), you can try printing out the path of the rc file being used by
adding the following to your script:

>>> import matplotlib
>>> print matplotlib.matplotlib_fname()

I missed this in my frustration last night (when I was last at my Mac). I'm confident that will be a huge help.

Also, you may want to check that the working directory is where you
think it is. For example, if you run a script from the terminal as:

$ python ~/path/to/file.py

Your working directory is '~' and not '~/path/to/'---so matplotlibrc
file located in the same directory as file.py would not be in the
working directory.

Yeah. I've got all that part of it straightened out. I'll try everything tonight and post back tomorrow.

Otherwise, I have no idea why the matplotlibrc is not being found in
the working directory.

Thanks, Tony. I really appreciate the help.
-paul

···

On Nov 3, 2009, at 3:08 PM, <PHobson@...2850...> > <PHobson@...2850... > > wrote:
> -----Original Message-----

-----Original Message-----
From: Tony S Yu [mailto:tonyyu@…1165…]

I won't mention how long it had been so I had done this, but I had to move the file to /Users/paul/.matplotlib in Terminal since Mac OSX won't let you do that in Finder (sigh). This made everything work splendidly. I even got it to work in the present working directory (not sure how I was messing that up earlier).

Thanks so much, Tony.

Paul M. Hobson
Senior Staff Engineer

···

-----Original Message-----
From: Tony S Yu [mailto:tonyyu@…1165…]
Sent: Tuesday, November 03, 2009 1:11 PM
To: Paul Hobson
Cc: Matplotlib Users
Subject: Re: [Matplotlib-users] Location matplotlibrc file on my Mac

(Paul, I hope you don't mind if I bring this bump this back to the
list).

Apparently I skimmed your original email and didn't see that you tried
putting the file in your working directory. That should work. (My
original response is still appropriate for a global rc file.)

As suggested on the mpl website (specifically:
http://matplotlib.sourceforge.net/users/customizing.html
), you can try printing out the path of the rc file being used by
adding the following to your script:

>>> import matplotlib
>>> print matplotlib.matplotlib_fname()

Also, you may want to check that the working directory is where you
think it is. For example, if you run a script from the terminal as:

$ python ~/path/to/file.py

Your working directory is '~' and not '~/path/to/'---so matplotlibrc
file located in the same directory as file.py would not be in the
working directory.

Otherwise, I have no idea why the matplotlibrc is not being found in
the working directory.

Best,
-Tony

--
Geosyntec Consultants
55 SW Yamhill St, Ste 200
Portland, OR 97204
Phone: (503) 222-9518
Web: www.geosyntec.com