Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line color not picked up in rc arguments? #4047

Closed
cel4 opened this issue Jan 28, 2015 · 8 comments
Closed

line color not picked up in rc arguments? #4047

cel4 opened this issue Jan 28, 2015 · 8 comments

Comments

@cel4
Copy link

cel4 commented Jan 28, 2015

Any idea what's going wrong here?` The issue is based on following SO question:

http://stackoverflow.com/questions/28191596/matplotlib-change-linewidth-on-all-subplots

This is the code:

%matplotlib inline
import matplotlib as mpl
import matplotlib.pylab as plt

mpl.rc('lines', linewidth=2, color="r")

plt.plot([1,2,3], [3,2,1])

And this the result:

image

Any idea why the color argument is not picked up?

According to the docs, it should work:
http://matplotlib.org/1.4.1/users/customizing.html#dynamic-rc-settings

@tacaswell
Copy link
Member

because it is being over-ridden by the color-cycle functionality

mpl.rc('axes', color_cycle=['r'])

will do what you want.

@tacaswell
Copy link
Member

Some changes to this code was made in #3855 but I don't think that caused this issue.

@tacaswell
Copy link
Member

I think this goes back to 9cfa335

attn @efiring

@tacaswell
Copy link
Member

And I am starting to think that the solution is to remove that bit of documentation.

@cel4 Has this code ever worked for you?

@WeatherGod
Copy link
Member

I don't think that code would have ever worked. I recall this question
coming up from time to time, and I think the answer was always that "lines"
wasn't meant for plot lines. But, seeing the linewidth of the plot affected
as it is, it makes me reconsider that position.

On Wed, Jan 28, 2015 at 10:08 AM, Thomas A Caswell <notifications@github.com

wrote:

And I am starting to think that the solution is to remove that bit of
documentation.

@cel4 https://github.com/cel4 Has this code ever worked for you?


Reply to this email directly or view it on GitHub
#4047 (comment)
.

@tacaswell
Copy link
Member

If you look in Line2D it does fall back to the rcparam if the input color is None, but there are no high-level functions which do not pass in a color to the Line2D.__init__

@efiring
Copy link
Member

efiring commented Feb 5, 2015

The "lines" parameters set defaults for LineCollection.
Overall, I agree that the problem here is the inherent messiness of the rcParams system combined with erroneous documentation.

@tacaswell
Copy link
Member

I am going to close this because it is tied up in the overhaul that rcparams/our document model which is already on our radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants