following on from my question here: Force the Y axis to only use integers and the great assistance I got there I have another issue with drawing a nice graph.
I'm using the pyplot module to draw a 2nd axis with some reference points on the top of the graph, and I can't seem to get the bottom and top x axis to agree on where the purportedly same location is...
If you look on the graph, you'll see the marker for 1 Kb (the dotted line) and the 2nd axis ticker label for the same do not agree. Same with the 1 Mb, but the 1Gb seems to line up.
The 2nd axis comes from an overlaid subplot (as I understand it) kicked off here:
fig = plt.figure()
ax1 = fig.add_subplot(111)
I am using the same constraints for both the axis:
ax1.set_xscale("log", basex=2)
ax1.set_xlim(0,34359738368)
and:
ax2 = ax1.twiny()
ax2.set_xlim(0,34359738368)
ax2.set_xscale("log", basex=2)
and the same values for the two sets of marks:
ax1.axvline(x=1024, color='black', linestyle='--')
ax1.axvline(x=1048576, color='black', linestyle='--')
ax1.axvline(x=1073741824, color='black', linestyle='--')
and:
ax2.set_xticks([1024, 1048576, 1073741824])
ax2.set_xticklabels(['1 Kbyte','1 Mbyte','1 Gbyte'], fontsize=8)
Any ideas why they aren't lining up? I'm sure I've done something dumb along the way..