i have a simple scatter plot, where the x axis and y axis are on different scales starting from 0. the x axis here ranges from 0 to 300 and the y axis from 0 to 1. i plot it as follows:
my_fig = plt.figure(figsize=(6,5), dpi=100)
x = rand(100)*300
y = rand(100)
plt.rcParams[‘xtick.direction’] = ‘out’
plt.rcParams[‘ytick.direction’] = ‘out’
i’d like to leave a bit of space between the origin and the x-axis 0 and between the origin and y-axis 0, which is why i added 0.05 to the end points of each axis. however, i’d like the space between 0 and the origin on either axis to be the same. since 0.05 on a scale from 0 to 300 is not the same amount of space as 0.05 on a scale from 0 to 1, this is not the effect i get. the yaxis looks good but the xaxis does not. how can i fix this?
second, how can i remove the upper x axis ticks and the right y axis ticks? these ticks are really not informative to the plot. ideally i would like to remove those axes altogether, and just have one x axis and one y axis – but i don’t want to manually plot the axes. is there a way to do this?
if that is not possible i’d like to at least remove those tick marks from the duplicate axes. any thoughts on this will be greatly appreciated.