0

I have 2 questions here:

  1. In my plot I see +2.8e8 and 4.7e1 as the additional labels on my x and y axis of my plots so I need a way to remove it
  2. The Y-axis of subplot-1 and X-axis of subplot-3 is not shown as per the values given in the plot function (variable name: latitude_truth)

Any pointers would be helpful .

Below is my code: Since the original list is too big ..sharing only few initial indices of the list

latitude_truth= [47.354211199999995, 47.354211199999995, 47.354211199999995, 47.354211199999995, 47.354211199999995, 47.354211199999995]

latitude_output= [47.35422, 47.354219, 47.354219, 47.354219, 47.354219, 47.354217999999996]

longitude_truth [7.947450099999999, 7.947450099999999, 7.947450099999999, 7.947450099999999, 7.947450099999999, 7.947450099999999]

longitude_output [7.947449, 7.947449, 7.947449, 7.94745, 7.94745, 7.94745

itow_truth= [282466000.0, 282467000.0, 282468000.0, 282469000.0, 282470000.0, 282471000.0]

itow_output= [282466000.0, 282467000.0, 282468000.0, 282469000.0, 282470000.0, 282471000.0]

fig, ax = plt.subplots(3)
ax01=ax[0].twinx()
ax[0].plot(itow_output,latitude_output,color = 'blue', label = 'Output')
ax01.plot(itow_truth,latitude_truth, color = 'green', label = 'Truth')
ax[0].legend(loc='upper right',fontsize="5")
ax01.legend(bbox_to_anchor=(0.99, 0.8), loc='upper right',fontsize="5")
ax01.get_yaxis().set_ticks([])
ax[0].set_xlim(itow_truth[0],itow_truth[-1])
ax[0].set_xlabel('Itow(msec)')
ax[0].title.set_text('Latitude (Truth/Output) vs Itow')

ax01=ax[1].twinx()
ax[1].plot(itow_output,longitude_output,color = 'blue', label = 'Output')
ax01.plot(itow_truth,longitude_truth, color = 'green', label = 'Truth')
ax[1].legend(loc='upper right',fontsize="5")
ax01.legend(bbox_to_anchor=(0.99, 0.8), loc='upper right',fontsize="5")
ax[1].set_xlabel('Itow (msec)')
ax[1].set_xlim(itow_truth[0],itow_truth[-1])
ax01.get_yaxis().set_ticks([])
ax[1].title.set_text('Longitude (Truth/Output) vs Itow')

ax01=ax[2].twinx()
ax[2].plot(latitude_output,longitude_output,color = 'blue', label = 'Output')
ax01.plot(latitude_truth,longitude_truth, color = 'green', label = 'Truth')
ax[2].set(xlabel="Latitude (deg)", ylabel="Longitude (deg)")
ax01.get_yaxis().set_ticks([])
ax[2].title.set_text('Latitude vs Longitude')
ax[2].legend(loc='upper right',fontsize="5")
ax01.legend(bbox_to_anchor=(0.99, 0.8), loc='upper right',fontsize="5")

for axs in ax.flat:
    plt.subplots_adjust(left=0.2,
                bottom=0.1,
                 right=0.9,
                 top=0.9,
                 wspace=0.9,
                 hspace=0.9)
                 
plt.show()

enter image description here

Kapil
  • 149
  • 1
  • 5

0 Answers0