You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With temporary styling, using colors with respect to the color cycle, like 'C0', is ignored if plt.show() is called outside of the with block. It only works properly if plt.show() is called inside the block.
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.
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.
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>
.
Activity
afvincent commentedon Jun 5, 2018
@rjurga Thank you for the report :)!
I can reproduce this on master (with Fedora 28 and Python 3.6 from conda).
WeatherGod commentedon Jun 6, 2018
tacaswell commentedon Jun 6, 2018
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.WeatherGod commentedon Jun 6, 2018
jklymak commentedon Jun 21, 2018
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?
WeatherGod commentedon Jun 21, 2018
jklymak commentedon Feb 9, 2019
I'm closing this as won't fix....