-
Notifications
You must be signed in to change notification settings - Fork 12
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
More Parameter Options #30
Comments
Hey @aidenguinnip , thanks for the suggestion. Sample plot (In the examples folder)import numpy as np
import pandas as pd
from plotly_calplot.calplot import calplot, month_calplot
# mock setup
dummy_start_date = "2019-01-01"
dummy_end_date = "2022-10-03"
dummy_df = pd.DataFrame(
{
"ds": pd.date_range(dummy_start_date, dummy_end_date),
"value": np.random.randint(
-10,
30,
(pd.to_datetime(dummy_end_date) - pd.to_datetime(dummy_start_date)).days
+ 1,
),
}
)
fig1 = calplot(
dummy_df,
x="ds",
y="value",
)
fig1.show() Changing the weekday nameyears_amt = dummy_df.ds.dt.year.max() - dummy_df.ds.dt.year.min() + 1
new_tickets = ["new", "tickets", "test", "nice", "foo", "bar", "zoo"]
for i in range(1, years_amt+1): # plotly's index starts at 1
fig1.update_layout(**{f"yaxis{i}_ticktext": new_tickets}) Changing the month name to frenchyears_amt = dummy_df.ds.dt.year.max() - dummy_df.ds.dt.year.min() + 1
new_tickets = ["janvier", "février", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre"]
for i in range(1, years_amt+1):
fig1.update_layout(**{f"xaxis{i}_ticktext": new_tickets}) |
I suppose that could work, but I was thinking of something less manual. I'm not necessarily trying to change the text away from a day or month, but instead to specify the datetime format using existing codes like these: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes An example would be:
|
Nice suggestion, this seems doable right away. I'll put it on my todo list, thanks. |
I forgot to mention another parameter suggestion:
Currently it starts with Monday at the top, but some people (like myself) like to start with Sunday. So having the option would be useful. I know that will cause issues with ISO weeks but it's worth the thought. |
It'd be great if there were more parameter options such as:
The text was updated successfully, but these errors were encountered: