M
If I understood correctly, to do what you want you would need to follow two steps:Allocation of own values tamizAbertura as axis marks X through ax.set_xticksChange the labels of the assigned marks using the list tamiz through ax.set_xtickslabels.Optionally you can remove all minor axis marks X as well as the corresponding lines of the grid. An example based on your code:import matplotlib.pyplot as plt
import matplotlib
tamiz= ["2", "1 1/2","1", "3/4", "1/2", "3/8", "1/4", "4", "10", "40", "100", "200"]
tamizAbertura = [ 50.0, 38.10, 25.0, 19.0, 12.5, 9.5, 6.3, 4.75, 2.0, 0.425, 0.150, 0.075]
pesopt = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
granulometria = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
Graficas
Sub-Grafico: 1
plt.subplot(121)
plt.title('Grafica de los pesos pasa tamiz')
plt.ylabel('Peso pasa tamiz')
plt.xlabel('Tamiz')
plt.plot(tamiz,pesopt,'o-',markersize=8, label='Peso pasa tamiz')
plt.legend(loc='upper right')
plt.grid()
Sub-Grafico: 2
plt.subplot(122)
plt.title('Curva Granulometrica')
plt.ylabel('Pasa tamiz')
plt.xlabel('Tamiz')
plt.semilogx(tamizAbertura,granulometria,'o-',markersize=8, data=None, label='Porciento pasa tamiz')
plt.legend(loc='upper right')
ax = plt.gca()
ax.grid(True, which='major', axis='both', linestyle='--')
ax.set_xticks(tamizAbertura)
ax.get_xaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter())
ax.get_xaxis().set_tick_params(which='minor', size=0)
ax.get_xaxis().set_tick_params(which='minor', width=0)
ax.set_xticklabels(tamiz)
plt.show()