0

I have added a secondary x-axis to my plot. The aim is just to provide another snippet of information to the data shown by the primary x and y axes. As you can see from the attached image, I have used twiny() command to share the y-axis and get_shared_x_axes().join(ax1,ax2) to align the secondary axis with the primary x-axis.

However, this results in plotting duplicate data. What I really need is in fact for the rectangular markers to provide another scale of information given by the circular markers in the attached image. Matplotlib examples handle this situation by writing a function for instance to convert Celsius degrees to Fahrenheit. In my case, there is no apparent relationship, just scatter data points. Could you please point me towards to the right direction? Many thanks!

Image to visualize the problem

WVJoe
  • 515
  • 7
  • 21
ebrehe
  • 1
  • 1
  • 2
    I think you want the third example here: https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html – Jody Klymak Feb 23 '21 at 00:55
  • It seems that this technique requires a newer mpl version, so couldn't try it out unfortunately. Also, not sure if interpolation can help really in this situation. – ebrehe Feb 23 '21 at 16:39

0 Answers0