Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

'multialign' is a text property in mpl when *newlines* are present. #53

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
theengineear merged 4 commits into master from issue-49
Jul 3, 2014

Conversation

@theengineear
Copy link
Contributor

@theengineear theengineear commented Jul 3, 2014

multiple-line annotations will now be tracekd properly in Plotly

Fixes #49

multiple-line annotations will now be tracekd properly in Plotly
Copy link
Contributor Author

h/o, probably need to update our tests...

Copy link
Contributor

etpinard commented Jul 3, 2014

Hmm.

Off the issue-49 branch:

dataviz1 = plt.figure(...)
dataviz1_plotly = tls.mpl_to_plotly(dataviz1)
dataviz1_plotly['layout']['annotations'][i]['align'] # --> 'center' for all i's

Randal made his source and info annotation using

text(1966, -8, "Data source: nces.ed.gov/programs/digest/2013menu_tables.asp" 
 "\nAuthor: Randy Olson (randalolson.com / @randal_olson)" 
 "\nNote: Some majors are missing because the historical data " 
 "is not available for them", fontsize=10)

which generated a left-align multi-line annotation (see here)

This suggests that mpl multi-line annotations are in fact left-aligned; hence, the plotly convention should include 'align': 'text' in the corresponding annotation object.

Copy link
Contributor Author

haha, oh man! it's a weird default for mpl. if you specify that you want the 'center' the surrounding box and don't specify that the multialignment, the default is indeed 'center' as i had. HOWEVER, if you don't specify the horizontalalignment as is the case in your example, it seems that mpl defaults to 'left', woof!

Copy link
Contributor Author

@etpinard, correction, looks like it defaults to horizontalalignment when unspecified. that should fix it. although, again i probably have to change a test or two to catch up!

Copy link
Contributor Author

k, good to go!

Copy link
Contributor

etpinard commented Jul 3, 2014

Nice! 👍

theengineear added a commit that referenced this pull request Jul 3, 2014
'multialign' is a text property in mpl when *newlines* are present.
@theengineear theengineear merged commit 9c07c32 into master Jul 3, 2014
@theengineear theengineear deleted the issue-49 branch July 3, 2014 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

matplotlylib - left align multi-line annotations

AltStyle によって変換されたページ (->オリジナル) /