I am surprised if one can make two x-axes in GMT. I tried with primary and secondary annotation options but it got confused in considering the inputs for both the axes. I attached the example plot below which I want to achieve. I am confused that how should I provide inputs for two x-axes.
I want to plot longitude and latitude on two x-axes, height on the y-axis, and the parameter value as a colormap. In general, I was providing (lat/lon, height, parameter) as an input. For the case of two x-axes, I tried to provide (lat, lon, height, parameter) with primary and secondary x-axes with -B option.
I am unable to achieve what I want. Do I need to write two different lines to make primary and secondary x-axes? In addition, If one can see the attached image the values of x-axes are not in order but it follows the flight path. First, it traveled to the south and come back to the north again. I think this will be solved once we can able to plot two x-axes. Am I correct?
GMT has secondary annotations of x-axes but not a double axis. So yes, you’ll need to plot a secondary x-axes and use custom annotations for your case.
Thanks, @Joaquim for the kind response. I tried that but it is not working out. As my parameter values are associated with lat, long, and altitude, I want to plot lat, long on the x-axis, and altitude on the y-axis. It means a parameter value has to be associated with these three parameters, but when I plot lat on one x-axis and separately long on the second x-axis at that time they are not connected and I couldn’t able to plot the whole flight path going and coming in a single curtain as I showed in the attached figure. Hope this makes sense.
Well, in a xy plot you cannot plot something depending on lon, lat & altitude but you can compute the accumulated distance along that lon, lat and make a plot accum_dist vs altitude. And after you can compute a dist from origin and use that to create a secondary axes in which you’ll use a custom axis annotations. Custom because normal axes settings must be monotonically increasing/decreasing and your going and return are not.