35 lines
1.2 KiB
Python
Executable File
35 lines
1.2 KiB
Python
Executable File
import matplotlib.pyplot as plt
|
|
import matplotlib.ticker as tkr
|
|
import seaborn as sns
|
|
import matplotlib.ticker as tkr
|
|
|
|
x = [0,1.1,2.3,5,90,100,1500]
|
|
y = [0,0.02,0.09,1,2,3,4]
|
|
|
|
tick_spacing = 1
|
|
|
|
fig1, ax1 = plt.subplots(1,1)
|
|
ax1.plot(x,y)
|
|
# ax.set_xticks([0,100,1500])
|
|
# ax.xaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
|
|
ax1.set(xscale="log")
|
|
ax1.xaxis.set_minor_locator(tkr.LogLocator(base=10, subs='all'))
|
|
ax1.xaxis.set_minor_formatter(tkr.NullFormatter())
|
|
ax1.xaxis.set_major_formatter(tkr.ScalarFormatter())
|
|
ax1.grid(True, which="both", ls="--", c='#d3d3d3')
|
|
ax1.set_xlim(left=0, right=150)
|
|
ax1.xaxis.set_major_locator(tkr.FixedLocator([0,1,3]))
|
|
|
|
fig2, ax2 = plt.subplots(1,1)
|
|
ax2.plot(x,y)
|
|
# ax.set_xticks([0,100,1500])
|
|
# ax.xaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
|
|
ax2.set(xscale="log")
|
|
ax2.xaxis.set_minor_locator(tkr.LogLocator(base=10, subs='all'))
|
|
ax2.xaxis.set_minor_formatter(tkr.NullFormatter())
|
|
ax2.xaxis.set_major_formatter(tkr.ScalarFormatter())
|
|
ax2.grid(True, which="both", ls="--", c='#d3d3d3')
|
|
ax2.set_xlim(left=0, right=150)
|
|
ax2.xaxis.set_major_locator(tkr.FixedLocator([0,1,30,500]))
|
|
plt.show()
|