-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
'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
Conversation
multiple-line annotations will now be tracekd properly in Plotly
h/o, probably need to update our tests...
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.
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!
@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!
k, good to go!
Nice! 👍
'multialign' is a text property in mpl when *newlines* are present.
multiple-line annotations will now be tracekd properly in Plotly
Fixes #49