0

I am trying to plot a trajectory on a map of Antarctica. There are three columns of data (longitude, latitude and 'x'). 'x' is used to colour in the trajectory based on its value.

In the end I want the trajectory to look like this, but be a continuous line. In this picture we zoom in on Antarctica.

enter image description here

I would like to do what is written here (comment by 'carla'): gnuplot linecolor variable in matplotlib?. In this comment, 'carla' shows how you can plot a continuous line with different colours for each section instead of using a scatter plot.

However, it seems like this can only be done when specifying values for 'llcrnrlon', 'llcrnrlat', 'urcrnrlon' and 'urcrnrlat'. With my data, if I specify these values, I get:

enter image description here

However, as the location is Antarctica, I would like to use the 'spstere' projection. Using this projection, the line is no longer plotted:

enter image description here

I think this has something to do with specifying the limits (Antarctica co-ordinates):

ax.set_xlim(-180, 180) and ax.set_ylim(-90, -60)

But if I do this, the map of Antarctica is no longer plotted:

enter image description here

So basically, my question is how do I get the line in the figure of Antarctica with the 'spstere' projection? Is there a way to specify the 'llcrnrlon', 'llcrnrlat', 'urcrnrlon' and 'urcrnrlat' and still get the 'spstere' projection?

Thanks, any help would be greatly appreciated.

chaos
  • 21
  • 3

0 Answers0