-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Temporary styling ignores color cycle #11376
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
Comments
@rjurga Thank you for the report :)! I can reproduce this on master (with Fedora 28 and Python 3.6 from conda). |
The problem is that the color references are resolved as late as possible.
This allows one to make changes to the style prior to rendering the plot. I
might even go so are as to allow one to change the colors after rendering
(doing multiple savefig()) -- don't quote me on that, but I seem to
remember that capability.
The drawback is this sort of apparent inconsistency, though.
…On Tue, Jun 5, 2018 at 7:44 PM, Adrien F. Vincent ***@***.***> wrote:
@rjurga <https://github.com/rjurga> Thank you for the report :)!
I can reproduce this on master (with Fedora 28 and Python 3.6 from conda).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11376 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-GqpWNmDd4pnpM2r0Zki-vLFeK5xks5t5xfdgaJpZM4UaU8F>
.
|
It does look like the color is resloved at draw time, however for other things that hit the rcparams we resolve them at call time to exactly avoid issues like this. We should probably move the resolution of the 'C#' values up sooner (have it be done in |
Context:
#6291 (introduction of CN)
#6374 (some bug fixes for CN)
#6499 (more bug fixes for CN)
and
#6499 (comment)
"""
also @WeatherGod <https://github.com/WeatherGod> was right, this is a
horrible can of worms.
"""
…On Wed, Jun 6, 2018 at 12:22 AM, Thomas A Caswell ***@***.***> wrote:
It does look like the color is resloved at draw time, however for other
things that hit the rcparams we resolve them at call time to exactly avoid
issues like this.
We should probably move the resolution of the 'C#' values up sooner (have
it be done in Line2D.set_color) and document the API change unless we can
dig up documentation of why we did it this way.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11376 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-P2sL2yiEjctoCxJKPwXDIWg8W1Rks5t51j0gaJpZM4UaU8F>
.
|
I dunno - I think if you drop out of context, you can/should expect strange things to do with the context to happen. i.e. in the code above, I'd plt.show or fig.savefig inside the context. Is this really a bug? |
The more I think about this, the more I am convinced this is not a bug, but
rather a good teaching point. The point of these color aliases is to be a
named reference to values that aren't easily accessible to the user. Within
the context, the color cycle can be known and fetched directly for the
plotting call. But the color-cycle outside of the context is not known, and
these color aliases are really the only way to reference those unknown
colors.
…On Thu, Jun 21, 2018 at 12:51 PM, Jody Klymak ***@***.***> wrote:
I dunno - I think if you drop out of context, you can/should expect
strange things to do with the context to happen. i.e. in the code above,
I'd plt.show or fig.savefig inside the context. Is this really a bug?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11376 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-Mai5RCHcEdtcQnrmMjRyj948Ffuks5t-88pgaJpZM4UaU8F>
.
|
I'm closing this as won't fix.... |
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:
This works fine and is the expected behavior:
Actual outcome
Please note that other elements of the style are working fine, such as the grid.
Expected outcome
Matplotlib version
print(matplotlib.get_backend())
): TkAggUsing matplotlib packaged by the linux distribution.
The text was updated successfully, but these errors were encountered: