先引用要用到的
import os
import matplotlib
matplotlib.use('Agg') //不画图,只写文件
from matplotlib.font_manager import *
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import Formatter
import matplotlib.dates as dates
IMAGE_URL = os.path.join(settings.STORE_ROOT, 'images')
myfont = FontProperties(fname=os.path.join(IMAGE_URL, 'STSONG.ttf'))
matplotlib.rcParams['axes.unicode_minus'] = False //之前配来弄中文乱码的,不知道是否有用
COLORS = ['#A92127', '#DA733C', '#FCDA5B', '#9ED24C', '#2D6465', '#C9A59C', '#D1D0A7', '#8C9489', '#756C74', '#183D75', '#449CEC', '#E2DFD9', '#B9A882', '#B29439'