FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

document when derived values (ex tick locations and labels) are computed · Issue #7556 · matplotlib/matplotlib · GitHub

Repository navigation

document when derived values (ex tick locations and labels) are computed #7556

Closed

Description

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:

x = np.arange(0,10)

plt.plot(x,x)
locs, labs = plt.xticks()
plt.xticks(locs[1:], labs[1:])
plt.show()

matplotlib 1.5.3
python 3.5.2
win 10

Activity

  1. dstansby commented on Dec 3, 2016

    Member

    Printing out your labels, it seems like they're just all empty strings, which might be why they're not showing up:

    >>> for lab in labs:
    ...     print(lab)
    ... 
    Text(0,0,'')
    Text(2,0,'')
    Text(4,0,'')
    Text(6,0,'')
    Text(8,0,'')
    Text(10,0,'')
    Text(0,0,'')
    
  2. tacaswell commented on Dec 3, 2016

    Member

    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?

  3. godaygo commented on Dec 3, 2016

    Author

    @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.

  4. tacaswell commented on Dec 3, 2016

    Member

    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

    fig, (ax1, ax2) = plt.subplots(1, 2, sharex='all')
  5. added this to the milestone on Dec 3, 2016
  6. 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
  7. modified the milestones: , on Oct 3, 2017
  8. 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!

  9. QuLogic commented on May 3, 2023

    Member

    This is now done whenever asked by #23170, so there is no longer the inconsistency that appears to happen as originally reported.

  10. modified the milestones: future releases, v3.6.0 on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL