{"action":"created","issue":{"url":"https://api.github.com/repos/altair-viz/altair/issues/797","repository_url":"https://api.github.com/repos/altair-viz/altair","labels_url":"https://api.github.com/repos/altair-viz/altair/issues/797/labels{/name}","comments_url":"https://api.github.com/repos/altair-viz/altair/issues/797/comments","events_url":"https://api.github.com/repos/altair-viz/altair/issues/797/events","html_url":"https://github.com/altair-viz/altair/issues/797","id":319004378,"number":797,"title":"Wrong time format when setting timeUnit in transform_timeunit()","user":{"login":"pagpires","id":7856031,"avatar_url":"https://avatars2.githubusercontent.com/u/7856031?v=4","gravatar_id":"","url":"https://api.github.com/users/pagpires","html_url":"https://github.com/pagpires","followers_url":"https://api.github.com/users/pagpires/followers","following_url":"https://api.github.com/users/pagpires/following{/other_user}","gists_url":"https://api.github.com/users/pagpires/gists{/gist_id}","starred_url":"https://api.github.com/users/pagpires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagpires/subscriptions","organizations_url":"https://api.github.com/users/pagpires/orgs","repos_url":"https://api.github.com/users/pagpires/repos","events_url":"https://api.github.com/users/pagpires/events{/privacy}","received_events_url":"https://api.github.com/users/pagpires/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-30T19:21:46Z","updated_at":"2018-04-30T19:28:43Z","closed_at":null,"author_association":"NONE","body":"This is inspired by the last example in this section (https://altair-viz.github.io/user_guide/transform.html#timeunit-within-encoding): I simply want to switch the timeunit from encoding to transformation:\r\n```python\r\nalt.Chart(temps).mark_rect().encode(\r\n    x=alt.X('date_date:O', axis=alt.Axis(format='%d')),\r\n    y=alt.Y('date_month:O', axis=alt.Axis(format='%b')),\r\n    color='max(temp):Q'\r\n).transform_timeunit(\r\n    'date_date', field='date', timeUnit='date'\r\n).transform_timeunit(\r\n    'date_month', field='date', timeUnit='month'\r\n)\r\n```\r\nAnd I didn't get the correct axis format:\r\n![image](https://user-images.githubusercontent.com/7856031/39445661-c9eb4b4e-4c89-11e8-9a3d-086783ca9db3.png)\r\n\r\nIf I change the date type from O to T, like:\r\n```python\r\nalt.Chart(temps_url).mark_rect().encode(\r\n    x=alt.X('date_date:T', axis=alt.Axis(format='%d')), # the modified line\r\n    y=alt.Y('date_month:O', axis=alt.Axis(format='%b')),\r\n    color='max(temp):Q'\r\n).transform_timeunit(\r\n    'date_date', field='date', timeUnit='date'\r\n).transform_timeunit(\r\n    'date_month', field='date', timeUnit='month'\r\n)\r\n```\r\n then the axis format is correct, but somehow the plot became 'not discrete':\r\n![image](https://user-images.githubusercontent.com/7856031/39445771-236d5c0c-4c8a-11e8-830b-ff8a582e4d01.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/altair-viz/altair/issues/comments/385503417","html_url":"https://github.com/altair-viz/altair/issues/797#issuecomment-385503417","issue_url":"https://api.github.com/repos/altair-viz/altair/issues/797","id":385503417,"user":{"login":"jakevdp","id":781659,"avatar_url":"https://avatars0.githubusercontent.com/u/781659?v=4","gravatar_id":"","url":"https://api.github.com/users/jakevdp","html_url":"https://github.com/jakevdp","followers_url":"https://api.github.com/users/jakevdp/followers","following_url":"https://api.github.com/users/jakevdp/following{/other_user}","gists_url":"https://api.github.com/users/jakevdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jakevdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakevdp/subscriptions","organizations_url":"https://api.github.com/users/jakevdp/orgs","repos_url":"https://api.github.com/users/jakevdp/repos","events_url":"https://api.github.com/users/jakevdp/events{/privacy}","received_events_url":"https://api.github.com/users/jakevdp/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T19:28:43Z","updated_at":"2018-04-30T19:28:43Z","author_association":"OWNER","body":"There's also a note about this in the vega-lite docs for timeunit transforms: https://vega.github.io/vega-lite/docs/timeunit.html#transform"}}
{"actor":{"display_login":"jakevdp"}}