0

In astronomy, we divide the night sky up in a way that does not make sense to matplotlib. I am essentially trying to plot something where the x axis looks like this:

200 250 300 350 0 100 150 200

Each integer should be a separate tick on the x axis. I have tried:

import matplotlib as plt

RA = [10, 45, 8, 340, 255]
DEC = [10, 2, 15, 8, 20]

ticks = [200, 250, 300, 350, 0, 100, 150, 200, 249.9999999]
plt.scatter(RA, DEC)
plt.xticks(DEC, tx)

But this returns the error:

UnitsConversionError: Can only apply 'greater' function to dimmensionless quantities when other argument is not a quantity (unless the later is also zero/infinity/nan

I have also tried using the plt.xlim keyword but there is not a clear way that I can see to break the limits into multiple sections. It seems to only take a high and a low number.

k.dav
  • 59
  • 1
  • 6
  • Your code as written doesn't make sense. `plt.scatter` and `tx` aren't recognised and even if that is addressed, there is no UnitsConversionError. Nor is any such error related with matplotlib to the best of my knowledge. But if I understand your intention, you want to arrange some numbers in the x axis from instead of 0-360, to 200-360-0-200. Kind of like how we have maps of the world centered around 0 degrees longitude. – Reti43 May 10 '21 at 00:21
  • Does this answer your question? [How do I plot galactic coordinates using matplotlib and astropy in python?](https://astronomy.stackexchange.com/q/32601) – Trenton McKinney May 10 '21 at 01:40
  • https://stackoverflow.com/q/29525356/7758804, https://stackoverflow.com/q/33105898/7758804, – Trenton McKinney May 10 '21 at 01:47

0 Answers0