Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug report
Bug summary
With temporary styling, using colors with respect to the color cycle, like'C0'
, is ignored ifplt.show()
is called outside of thewith
block. It only works properly ifplt.show()
is called inside the block.
Code for reproduction
This reproduces the bug:
importmatplotlib.pyplotaspltwithplt.style.context('seaborn'):plt.axhline(0,color='C0')plt.axhline(1,color='C1')plt.axhline(2,color='C2')plt.show()
This works fine and is the expected behavior:
importmatplotlib.pyplotaspltwithplt.style.context('seaborn'):plt.axhline(0,color='C0')plt.axhline(1,color='C1')plt.axhline(2,color='C2')plt.show()
Actual outcome
Please note that other elements of the style are working fine, such as the grid.
Expected outcome
Matplotlib version
- Operating system: Solus Linux
- Matplotlib version: 2.2.2
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg - Python version: 3.6.5
Using matplotlib packaged by the linux distribution.