Skip to content

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

@mivanc

Description

@mivanc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions