Skip to content
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

adding new line in x_axis_format when using x_is_date=True #163

Open
mivanc opened this issue Sep 25, 2019 · 0 comments
Open

adding new line in x_axis_format when using x_is_date=True #163

mivanc opened this issue Sep 25, 2019 · 0 comments

Comments

@mivanc
Copy link

mivanc commented Sep 25, 2019

Usually, I am using following formatting for datetimes on x-axis in matplotlib (between date and time is new line \n):
import matplotlib.dates as md
XFMT = md.DateFormatter('%d-%b-%Y\n %H:%M:%S\n')

ax.xaxis.set_major_formatter(XFMT)

I tried to implement similar formatting to python-nvd3/lineWithFocusChart. But when I added ‘\n’ to x_axis_format, it crashes:
x_axis_format="%d %b %Y \n %H:%M"

I played around with different options like raw text or double backslashes, but nothing works:
x_axis_format=r"%d %b %Y \n %H:%M"
x_axis_format=r"%d %b %Y \n %H:%M"

Does anyone have an idea how to solve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant