I certainly do not know, but I it seems that this behavior is very strange. plt.xticks does not accept labels which they return as arguments. As a simple example of this odd behavior:
This most likely due to the tick labels being determined at draw time and you are asking for the labels before the figure has been drawn for the first time.
We have been systematically been making the library lazier and discovering that people have been relying on some of these details.
@tacaswell Thank you for your insight. I was trying to set tick labels from one graph to another, because I think that labels are determined after I call plt.plot. I don't know matplotlib well as you see (and if it's a way of implementation it's ok), and maybe I harried with the issue. Sorry for that!
p.s.: Also I didn't find any docs about matplotlib execution model (only some topics about zorder and etc) that is why this behavior wasn't obvious to me.
changed the title [-]Ticks does not work with labels which they return.[/-][+]document when derived values (ex tick locations and labels) are computed[/+]on Dec 3, 2016
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
dstansby commented on Dec 3, 2016
Printing out your labels, it seems like they're just all empty strings, which might be why they're not showing up:
tacaswell commented on Dec 3, 2016
This most likely due to the tick labels being determined at draw time and you are asking for the labels before the figure has been drawn for the first time.
We have been systematically been making the library lazier and discovering that people have been relying on some of these details.
@godaygo what are you trying to do?
godaygo commented on Dec 3, 2016
@tacaswell Thank you for your insight. I was trying to set tick labels from one graph to another, because I think that labels are determined after I call plt.plot. I don't know matplotlib well as you see (and if it's a way of implementation it's ok), and maybe I harried with the issue. Sorry for that!
p.s.: Also I didn't find any docs about matplotlib execution model (only some topics about zorder and etc) that is why this behavior wasn't obvious to me.
tacaswell commented on Dec 3, 2016
I suggest you send a question to the mailing list with your application.
If the two axes are in the same figure you can do something like
github-actions commented on Apr 3, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
QuLogic commented on May 3, 2023
This is now done whenever asked by #23170, so there is no longer the inconsistency that appears to happen as originally reported.