question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PosTag does not sort xticklabels in frequency mode

See original GitHub issue

Describe the bug I noticed a strange behavior while working with PosTag visualizer. When in frequency mode it does sort the bars but the x tick labels remain in the initial order. Screenshot (17)

To Reproduce

corpus = load_corpus('data/hobbies')
docs = corpus.data
labels = corpus.target
tagged_stanzas = [nltk.pos_tag(nltk.word_tokenize(sent)) for sent in docs]
tag = [tagged_stanzas]

_, (ax1,ax2) = plt.subplots(1,2)

viz = PosTagVisualizer(ax=ax1)
viz.fit(tag)
viz.poof()
viz.ax.grid(False)

oz = PosTagVisualizer(frequency=True, ax=ax2)
oz.fit(tag)
oz.poof()
oz.ax.grid(False)

where load_corpus is the function from yellowbrick contributing section

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
naresh-bachwanicommented, Jun 4, 2019

Yes it was fixed but we did not add tests for it. I will fix it with my new PR that adds helper function for stack bar charts.

1reaction
bbengfortcommented, May 21, 2019

This will likely be fixed in #847 - thanks @naresh-bachwani!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matplotlib set x tick labels does not swap order - Stack Overflow
Use matplotlib's categorical feature. You may predetermine the order of categories on the axes by first plotting something in the correct ...
Read more >
Set or query x-axis tick labels - MATLAB xticklabels - MathWorks
m = xticklabels('mode') returns the current value of the x-axis tick labels mode, which is either 'auto' or 'manual' . By default, the...
Read more >
ELOQUENT SCIENCE - Weather and Climate Laboratory
individuals searching for “Johnstown flood 1977” may not find your manu- script. Using common word order will also help your article be found...
Read more >
How to change the tick frequency on x or y axis in matplotlib
and the x axis' ticks are plotted in intervals of 5. ... You could explicitly set where you want to tick marks with...
Read more >
Untitled
Baby won't nap on vacation, Oracle purchasing setup, Jalalpur jattan city. ... Spatial frequency selectivity, Glutton's tools, Hotondo seaspray 386, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found