{"action":"created","issue":{"url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/722","labels_url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/722/labels{/name}","comments_url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/722/comments","events_url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/722/events","html_url":"https://github.com/dcjones/Gadfly.jl/issues/722","id":110753206,"number":722,"title":"Custom labels + multiple layers","user":{"login":"bdeonovic","id":805168,"avatar_url":"https://avatars.githubusercontent.com/u/805168?v=3","gravatar_id":"","url":"https://api.github.com/users/bdeonovic","html_url":"https://github.com/bdeonovic","followers_url":"https://api.github.com/users/bdeonovic/followers","following_url":"https://api.github.com/users/bdeonovic/following{/other_user}","gists_url":"https://api.github.com/users/bdeonovic/gists{/gist_id}","starred_url":"https://api.github.com/users/bdeonovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdeonovic/subscriptions","organizations_url":"https://api.github.com/users/bdeonovic/orgs","repos_url":"https://api.github.com/users/bdeonovic/repos","events_url":"https://api.github.com/users/bdeonovic/events{/privacy}","received_events_url":"https://api.github.com/users/bdeonovic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-09T23:44:19Z","updated_at":"2015-10-10T15:56:13Z","closed_at":null,"body":"The following has unexpected (to me) behavior. \r\n\r\nThe x-coords and labels of the second layer override the x-coords and labels of the first layer. \r\n```julia\r\nn=10                                                                                                             \r\nseq = [['A', 'C', 'G', 'T'][r] for r in rand(1:4, 2*n)]                                                          \r\nys1 = rand(n)                                                                                                        \r\nys2 = rand(n)                                                                                                       \r\n                                                                                                               \r\nplot(layer(x=1:n, y=ys1, Geom.line),layer(x=(n+1):2*n, y=ys2, Geom.line), Scale.x_discrete(labels=x -> seq[x])) \r\n```\r\n![screenshot from 2015-10-09 18 42 40](https://cloud.githubusercontent.com/assets/805168/10407793/97955d60-6eb5-11e5-9117-c6a892d210e5.png)\r\n\r\nIf I leave out the discrete scale I get the following\r\n```julia\r\nn=10                                                                                                             \r\nseq = [['A', 'C', 'G', 'T'][r] for r in rand(1:4, 2*n)]                                                          \r\nys1 = rand(n)                                                                                                        \r\nys2 = rand(n)                                                                                                       \r\n                                                                                                               \r\nplot(layer(x=1:n, y=ys1, Geom.line),layer(x=(n+1):2*n, y=ys2, Geom.line)) \r\n```\r\n![screenshot from 2015-10-09 18 42 20](https://cloud.githubusercontent.com/assets/805168/10407802/ada20108-6eb5-11e5-87d8-705c06debe2a.png)\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/comments/147101658","html_url":"https://github.com/dcjones/Gadfly.jl/issues/722#issuecomment-147101658","issue_url":"https://api.github.com/repos/dcjones/Gadfly.jl/issues/722","id":147101658,"user":{"login":"bdeonovic","id":805168,"avatar_url":"https://avatars.githubusercontent.com/u/805168?v=3","gravatar_id":"","url":"https://api.github.com/users/bdeonovic","html_url":"https://github.com/bdeonovic","followers_url":"https://api.github.com/users/bdeonovic/followers","following_url":"https://api.github.com/users/bdeonovic/following{/other_user}","gists_url":"https://api.github.com/users/bdeonovic/gists{/gist_id}","starred_url":"https://api.github.com/users/bdeonovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdeonovic/subscriptions","organizations_url":"https://api.github.com/users/bdeonovic/orgs","repos_url":"https://api.github.com/users/bdeonovic/repos","events_url":"https://api.github.com/users/bdeonovic/events{/privacy}","received_events_url":"https://api.github.com/users/bdeonovic/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T15:56:13Z","updated_at":"2015-10-10T15:56:13Z","body":"@tbreloff  I ended up doing exactly what you suggested (using continuous scale, setting the exact ticks I want) and it worked out just fine. @protogeezer this is how I would change the above code\r\n\r\n```julia\r\nn=10                                                                                                             \r\nseq = [['A', 'C', 'G', 'T'][r] for r in rand(1:4, 2*n)]                                                          \r\nys1 = rand(n)                                                                                                        \r\nys2 = rand(n)                                                                                                       \r\n\r\n plot(layer(x=1:n, y=ys1, Geom.line),layer(x=(n+1):2*n, y=ys2, Geom.line),\r\n Scale.x_continuous(labels=x -> string(seq[x])), Stat.xticks(ticks=collect(1:(2*n))))\r\n```"}}