import os
import math
import pandas as pd
import numpy as np
import datetime
import matplotlib as mpl
import scipy as spy
from scipy.optimize import curve_fit
from matplotlib import pyplot as plt
from datetime import datetime,timedelta
from matplotlib.ticker import MultipleLocator, FormatStrFormatter,FixedFormatter
ax = plt.gca()
ax.scatter([70,100,600,1000],[4,5,6,8])
ax.set_xlim(50, 700)
ax.set_xscale('log')
ax.xaxis.set_major_locator(mpl.ticker.LogLocator(base=10, numticks=2))
xmajorFormatter = FormatStrFormatter('%3.0f') #设置x轴标签文本的格式
ax.xaxis.set_major_formatter(xmajorFormatter)
ax.xaxis.set_minor_locator(mpl.ticker.FixedLocator(locs=[50,60,70,80,90,200,300,400,500,600,700]))
ax.xaxis.set_minor_formatter(FixedFormatter(seq=['5','6','7','8','9','2','3','4','5','6','7']))#设置x轴标签文本的格式
ax.tick_params(which='major',length=12,labelsize=13)
ax.tick_params(which='minor',length=4,labelsize=9)

spectral distribution.png
网友评论