{"action":"opened","issue":{"url":"https://api.github.com/repos/wilkelab/cowplot/issues/25","repository_url":"https://api.github.com/repos/wilkelab/cowplot","labels_url":"https://api.github.com/repos/wilkelab/cowplot/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/wilkelab/cowplot/issues/25/comments","events_url":"https://api.github.com/repos/wilkelab/cowplot/issues/25/events","html_url":"https://github.com/wilkelab/cowplot/issues/25","id":134366814,"number":25,"title":"Axis label justification goes bananas after `switch_axis_position` for `angle = 90`","user":{"login":"Ax3man","id":15309336,"avatar_url":"https://avatars.githubusercontent.com/u/15309336?v=3","gravatar_id":"","url":"https://api.github.com/users/Ax3man","html_url":"https://github.com/Ax3man","followers_url":"https://api.github.com/users/Ax3man/followers","following_url":"https://api.github.com/users/Ax3man/following{/other_user}","gists_url":"https://api.github.com/users/Ax3man/gists{/gist_id}","starred_url":"https://api.github.com/users/Ax3man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ax3man/subscriptions","organizations_url":"https://api.github.com/users/Ax3man/orgs","repos_url":"https://api.github.com/users/Ax3man/repos","events_url":"https://api.github.com/users/Ax3man/events{/privacy}","received_events_url":"https://api.github.com/users/Ax3man/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-17T18:54:02Z","updated_at":"2016-02-17T18:54:02Z","closed_at":null,"body":"While answering [a question on stackoverflow](http://stackoverflow.com/questions/35463877/ggplot-left-aligned-x-axis-labels-when-using-cowplot-to-flip-x-axis/35465052#35465052) I found that the justification for the axis labels seems to bug out if the angle is 90 degrees.\r\n\r\nA simple (hackish) fix is to add a small amount to the degrees.\r\n\r\nExample:\r\n```\r\nlibrary(reshape2)\r\nlibrary(ggplot2)\r\nlibrary(cowplot)\r\n\r\n# some toy data\r\nset.seed(1)\r\nmydata <- mtcars[, c(1, 3, 4, 5, 6, 7)]\r\n\r\n# to show difference in justification better, make names of unequal length \r\nnames(mydata) = paste0(sample(c(\"mtcars_\", \"\"), 6, replace = TRUE), names(mydata))\r\ncormat <- round(cor(mydata), 2)\r\n\r\nmelted_cormat <- melt(cormat)\r\nhead(melted_cormat)\r\n\r\n\r\nplot <- ggplot(data = melted_cormat, aes(x=Var1, y=Var2, fill=value)) + \r\n        geom_tile() +\r\n        theme_bw(base_size=20) + xlab(\"\") + ylab(\"\") +\r\n        theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 0.5))\r\nggdraw(switch_axis_position(plot, 'x'))\r\n```\r\nThis gives weird labels (you can mess around with `vjust` and `hjust`).\r\n\r\nBut this version gives the desired result:\r\n\r\n```\r\nplot <- ggplot(data = melted_cormat, aes(x=Var1, y=Var2, fill=value)) + \r\n  geom_tile() + theme_bw(base_size=20) + xlab(\"\") + ylab(\"\")+\r\n  theme(axis.text.x=element_text(angle=90 + 1e-09, hjust = 0, vjust=1)) +\r\n  coord_equal(expand = 0)\r\nggdraw(switch_axis_position(plot, 'x'))\r\n```\r\n\r\nThanks for a great package!"}}