Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve Rainbow text example #13914

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

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

  • Refactor the function to draw a single text line and control the orientation via a parameter.
  • Use actual rainbow colors for the colors.

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the text is now laid out incorrectly
test

(the previous version was fine)

anyone can dismiss after fix

text.get_transform(), x=ex.width, units='dots')
assert orientation in ['horizontal', 'vertical']
if orientation == 'vertical':
kwargs['rotation'] = 90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kwargs.update(rotation=90, verticalalignment="bottom")

@anntzer anntzer added this to the v3.1-doc milestone Apr 15, 2019
@anntzer anntzer merged commit 7bb70b9 into matplotlib:master Apr 15, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 15, 2019
dstansby added a commit that referenced this pull request Apr 15, 2019
…914-on-v3.1.x

Backport PR #13914 on branch v3.1.x (Improve Rainbow text example)
@QuLogic QuLogic modified the milestones: v3.1-doc, v3.1.0 Apr 15, 2019
@kolibril13
Copy link
Contributor

Currently, the example is broken again:
https://matplotlib.org/stable/gallery/text_labels_and_annotations/rainbow_text.html
image
However, the spacing looks fine when running the exact same script locally.
Mabye there is a certain rcParams set in the documentation, that is causing this issue?

@timhoffm timhoffm deleted the rainbow-text branch June 10, 2022 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants