-1

The question is purely on plotting trick, which helps to understand the data better. I have a data file with position (RA and DEC) of the source, error in RA/DEC and energy observed in the source. For example,

RA || DEC || Ang_error || Energy

25.4 || 45.5 || 2 || 10

35.6 || -12.7 || 3 || 5

Basically, I like to plot a map using RA in x-axis and DEC in the y-axis with angular error information. So each entry in the map should be a circle with RA and DEC as its centre and error as its radius. This is the first requirement and the second is, I would like to represent each circle in different colours corresponding to the energy value. Say, if I choose "RdBu" colour map, Red colour represents the lowest energy and "blue" represents the highest energy or vice versa.

Could someone help with this situation?

Mohanraj S
  • 13
  • 3

1 Answers1

0

You should be able to use the Matplotlib scatter function for this. E.g.,

from matplotlib import pyplot as pl

ra = [25.4, 35.6]
dec = [45.5, -12.7]
ang_err = [2, 3]
energy = [10, 5]

fig, ax = pl.subplots()
ax.scatter(ra, dec, s=ang_err, c=energy, cmap='RdBu')

Alternatively, you could use something like seaborn and its scatterplot:

import seaborn

ra = [25.4, 35.6]
dec = [45.5, -12.7]
ang_err = [2, 3]
energy = [10, 5]

data = {'ra': ra, 'dec': dec, 'ang_err': ang_err, 'energy': energy}

fig = seaborn.scatterplot(x='ra', y='dec', data=data, hue='energy', size='ang_err')
Matt Pitkin
  • 3,989
  • 1
  • 18
  • 32