Quantcast
Channel: Uncategorized - Matplotlib
Viewing all articles
Browse latest Browse all 51

Why minor xtick dont show up?

$
0
0

I run following codes, but minor xtick don’t show up correctly
I am in matplotlib 3.10.1, python 3.12.2

import matplotlib
from matplotlib import pyplot as plt
from matplotlib import rc
import numpy
import matplotlib.transforms as mtransforms

rc('text', usetex=True)
plt.rc('font',family='Times New Roman')


x = numpy.arange(1,10000)
y = numpy.log(x)

fig, ax = plt.subplots(2,2,figsize=(6.4,5.0))

for i in range(2):
	for j in range(2):
		ax[i,j].plot(x,y)

for i in range(2):
	for j in range(2):
		ax[i,j].set_xscale("log")
		ax[i,j].tick_params("both", which='both', direction='in', labelsize=14)

		ax[i,j].minorticks_on()
		ax[i,j].tick_params("both", which='major', length=6.0)
		ax[i,j].tick_params("both", which='minor', length=3.0)

		ax[i,j].set_xticks([0.01, 1,  100, 10000])
		ax[i,j].minorticks_on()

plt.tight_layout(h_pad=0.1, w_pad=0.5)
plt.show()

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 51

Latest Images

Trending Articles



Latest Images