1

I'm trying to set a custom ticks on the x-axis on a log-log plot. I want the ticks on the x-axis to be multiple of 0.03 (so 0.03, 0.06,...,0.3) but spaced like a log scale. The script I used is below.

import numpy as np
import matplotlib.pyplot as plt

x = np.asarray([0.107,0.125,0.150,0.175])
y = np.asarray([343,300,257,230])
plt.plot(x, y,'ro')
plt.set_xticks([0.03,0.06,0.09,0.12,0.15,0.18,0.21,0.24,0.27,0.30])
plt.xscale('log')
plt.yscale('log')
plt.axis([0.03,0.3,10,1000])
plt.grid(True, which = 'both')
plt.show()

What can I do to make it show what I want?

snowball
  • 11
  • 1

0 Answers0