Jonno,

Unfortunately, I'm not sure that the matplotlibrc file will cover every
type of customization. If you don't find it on the customization page (
http://matplotlib.org/users/customizing.html), then it might not be
possible to have it be a default.

In principle, I like the matplotlibrc file; however, it does cause some
problems if you are distributing code to colleagues. When they run your
code, the plots will not look the same unless they have your rc parameters
as well. Perhaps an alternative would be to write a small module that you
could import/distribute. Set the PYTHONPATH variable (
https://docs.python.org/2/using/cmdline.html#environment-variables), so
that it is importable in any script. It could look something like this:

### mpl_format.py ###

import matplotlib.pyplot as plt

plt.rc('lines', linewidth=2, color='r')
plt.rc('font', size=16.0)

def ax_format(axes):
    axes.get_xaxis().tick_bottom()
    axes.get_yaxis().tick_left()

#########

And then in your code, you could do something like this:

### fake_example.py ###

import matplotlib.pyplot as plt

import mpl_format

ax = plt.axes()

ax.plot([1,3,7], [-1, 4, 2], 'o-')
mpl_format.ax_format(ax)

plt.show()

########

I hope this helps.

Ryan

On Thu, Sep 11, 2014 at 1:18 PM, Jonno <jonnojohn...@gmail.com> wrote:

> I'm looking for some help understanding how I can add new lines to my
> matplotlibrc but I'm struggling to correlate the default matplotlibrc to
> the api.
>
> For example if I want to have axis ticks only show up on the bottom and
> left axes how would I add that to mapltlotlibrc?
> I can do this in my code with:
> ax.get_xaxis().tick_bottom()
> ax.get_yaxis().tick_left()
> But don't get how to do it using the documentation at
> http://matplotlib.org/api/axis_api.html
>
> Thanks,
>
> Jonno.
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce
> Perforce version control. Predictably reliable.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to