{"action":"created","issue":{"url":"https://api.github.com/repos/aplpy/aplpy/issues/162","labels_url":"https://api.github.com/repos/aplpy/aplpy/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/aplpy/aplpy/issues/162/comments","events_url":"https://api.github.com/repos/aplpy/aplpy/issues/162/events","html_url":"https://github.com/aplpy/aplpy/issues/162","id":26734984,"number":162,"title":"Bypass fixes made by astropy.wcs in some cases","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-02-01T09:29:20Z","updated_at":"2015-02-18T14:54:37Z","closed_at":null,"body":"If a header has velocities in km/s, astropy updates it to m/s, but in some cases users might want the plot to be in km/s. Maybe the right place to fix this is to have a workaround in APLpy.\r\n\r\ncc @keflavich "},"comment":{"url":"https://api.github.com/repos/aplpy/aplpy/issues/comments/74876525","html_url":"https://github.com/aplpy/aplpy/issues/162#issuecomment-74876525","issue_url":"https://api.github.com/repos/aplpy/aplpy/issues/162","id":74876525,"user":{"login":"keflavich","id":143715,"avatar_url":"https://avatars.githubusercontent.com/u/143715?v=3","gravatar_id":"","url":"https://api.github.com/users/keflavich","html_url":"https://github.com/keflavich","followers_url":"https://api.github.com/users/keflavich/followers","following_url":"https://api.github.com/users/keflavich/following{/other_user}","gists_url":"https://api.github.com/users/keflavich/gists{/gist_id}","starred_url":"https://api.github.com/users/keflavich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keflavich/subscriptions","organizations_url":"https://api.github.com/users/keflavich/orgs","repos_url":"https://api.github.com/users/keflavich/repos","events_url":"https://api.github.com/users/keflavich/events{/privacy}","received_events_url":"https://api.github.com/users/keflavich/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T14:54:37Z","updated_at":"2015-02-18T14:54:37Z","body":"We can discuss API, though.  Perhaps `F.ticks.set_xunit`?\r\n\r\nThe less hack-ish approach for the axis labeling might be something like this (though you would want it as a method on each axis, not accepting an axis as I've done here):\r\n```\r\ndef set_unit(self, axis, unit):\r\n     origunit = u.Unit(self._wcs.wcs.cunit[axis])\r\n     conv = origunit.to(unit)\r\n     mywcs = self._wcs.sub([axis+1])\r\n     new_ticklabels = [\"{0.1f}\".format(x) for x in mywcs.wcs_pix2world(self._ax1.get_yticks())]\r\n     F._ax1.set_yticklabels(new_ticklabels)\r\n     F._ax1.set_ylabel(\"{0} {1}\".format(mywcs.wcs.ctype[0], unit.to_string())\r\n```\r\nbut of course this has the problem of not being persistent when recentering, zooming, etc, I believe."}}