Skip to content

Setting lines.markeredgecolor in rcParams affects the ticks' mark color too #14546

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

Closed
marccheneau opened this issue Jun 13, 2019 · 5 comments
Closed
Milestone

Comments

@marccheneau
Copy link

Bug report

Bug summary

Setting "lines.markeredgecolor" in rcParams affects the ticks' mark color too. This is unexpected I guess.

Using "axes.prop_cycle" and the cycler label "markeredgecolor" produces the expected result, that is, it only changes the marker edge color and not the ticks' mark color.

Code for reproduction

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rcParams["lines.markeredgecolor"] = "red"

x = np.linspace(0, 10)
plt.plot(x, x**2, marker="o")
plt.show()

Actual outcome

The ticks' mark color has turned red, together with the marker edge color.

Expected outcome

The ticks' mark color should ramin to its default value.

Matplotlib version

  • Operating system: Archlinux
  • Matplotlib version: 3.1.0 (installed using the Archlinux's package manager)
  • Matplotlib backend: Qt5Agg
  • Python version: 3.7.3
@WeatherGod
Copy link
Member

WeatherGod commented Jun 14, 2019 via email

@WeatherGod
Copy link
Member

At the moment, I am inclined to close this as "not a bug", but I could be convinced otherwise.

@timhoffm
Copy link
Member

timhoffm commented Jun 14, 2019

I disagree. Though technically, the ticks may be implemented as markers, conceptually, they are quite different from markers for data points (and should probably almost always have different properties). I could otherwise argue that ticks are lines and should follow all the lines.*properties, which they don't for good reasons.

Ticks are an independent entity and should be treated as such. They also already follow xtick.color. Having both is rather confusing (even though xtick.color simultaneously colors the tick and the tick label - which is another maybe not obvious behavior).

@marccheneau
Copy link
Author

I tried to globally (meaning in the rcParams) and independently set the color of the "data markers" and of the ticks' marks using lines.markeredgecolor together with xtick.color but this doesn't work: the color of the ticks' marks is bound to that of the data markers.

It does remain possible to set the data marker's color alone when calling the plot function, but I keep thinking that the possibility for a global setting would be desirable too. It's not a bug, right, but maybe a missing feature.

@QuLogic
Copy link
Member

QuLogic commented Apr 24, 2020

This was fixed by #16847.

@QuLogic QuLogic added this to the v3.3.0 milestone Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants