X Tutup
Skip to content

Figure linewidth default in rcparams #6083

@NGJROMO

Description

@NGJROMO

Hello,

I am using:
Matplotlib 1.5.1
Python 3.5
Windows 7 Professional 64-bit (6.1, Build 7601)

And I installed Python and Matplotlib newly through Anaconda.

I used to set my default plot settings with the following code:

import matplotlib as mpl
mpl.rcParams['savefig.bbox']='standard'
mpl.rcParams['axes.linewidth']=1
mpl.rcParams['axes.grid']=True
mpl.rcParams['grid.linestyle']='-'
mpl.rcParams['grid.linewidth']=1
mpl.rcParams["savefig.facecolor"]='white'
mpl.rcParams['savefig.edgecolor']='black'
mpl.rcParams['figure.edgecolor']='black'    
mpl.rcParams["figure.facecolor"]='white'
mpl.rcParams["axes.facecolor"]='white'
mpl.rcParams['axes.edgecolor']='black'

Which gave me a plot with a black grid, a white background and a black line around the plot. I initialized my figures with plt.figure():

norm2

After updating to Matplotlib 1.5.1 I run the same code, but the black box around the figure is gone:

norm1

I can manually fix the issue by initializing my figures with plt.figure(linewidth=1) (Which is how I produced above plots), but I would like to set the default figure linewidth in rcparams. To my knowledge this is currently not possible. e.g. an entry such as:

mpl.rcParams["figure.linewidth"]

would be perfect. It would be much appreciated if I could get some support on this topic.

I don't remember the exact version of Python and Matplotlib in which this used to work, is there a way to check my update history in Anaconda?

Kind regards,

Nick

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup