-
Notifications
You must be signed in to change notification settings - Fork 207
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
scale_x_datetime **kwargs for breaks and labels #25
Comments
Checkout the documentation of the scaling library mizani, the functions are defined in there. |
Thank you for your help. In the example below I would like to extend the x labels up to 'Aug-2017' and have minor breaks shown up to that point as well. How to achieve this? Do I need to use
|
You do not need to create the explicit breaks and labels. This should work limits = df_test['date'].min(), df_test['date'].max() # change as you need
ggplot(df_test, aes('date', 'value')) + \
geom_line() + \
scale_x_date(breaks=date_breaks('1 month'),
labels=date_format('%b-%Y'),
minor_breaks=minor_breaks(n=5),
limits=limits) +\
scale_y_continuous() You cannot use |
Also, if all the intervals between the breaks are not equal, the minor breaks will not be able to extend beyond the limits. |
Noted, thank you for the quick feedback. |
Hi, Minor comment: it will be nice to add second resolution to the date_breaks() function in the mizani.breaks module. I was able to add this line: and add the "SecondLocator" to same module: LOCATORS = { Code is working find, but don't know if there is any other dependencies! Thanks you. |
Hi,
Is it possible to define the
**kwargs
forscale_x_datetime
in the same way as the Pythonggplot
library, for example usingbreaks='1 week'
andlabels='%W'
? Theggplot
library is usingdate_breaks
anddate_format
helpers to achieve this goal, is there an equivalent inplotnine
?The code below throws an error:
PlotnineError: 'Breaks and labels have unequal lengths'
Using
plotnine.__version__ = '0.2.1'
This is what I am referring to, from
ggplot
ggplot scales docsThanks for your work, great library coverage compared to the original
ggplot2
inR
.The text was updated successfully, but these errors were encountered: