美文网首页
python绘制谱分布

python绘制谱分布

作者: Aerosols | 来源:发表于2019-10-16 19:02 被阅读0次
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

相关文章

网友评论

      本文标题:python绘制谱分布

      本文链接:https://www.haomeiwen.com/subject/gsnumctx.html