如何将matplotlib中的annotate的标记从圆圈改成加号或点?

plt 图片
统计一个数据的异常点,用箱型图分析,异常点标注的是用圆圈,因为有几个值几乎重叠,圆圈看着太大了,看了官方文档也找不到在哪里改标注,不懂哪里修改成'+'。

#-*- coding: utf-8 -*-
import pandas as pd

catering_sale =  r'C:\Users\81284\OneDrive\python datamining\Python数据分析与挖掘实战\chapter3\demo\data\catering_sale.xls' #餐饮数据
data = pd.read_excel(catering_sale, index_col = u'日期') #读取数据,指定“日期”列为索引列

import matplotlib.pyplot as plt #导入图像库
plt.rcParams['font.sans-serif'] = ['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号

plt.figure() #建立图像
p = data.boxplot(return_type='dict') #画箱线图,直接使用DataFrame的方法
x = p['fliers'][0].get_xdata() # 'flies'即为异常值的标签
y = p['fliers'][0].get_ydata()
y.sort() #从小到大排序,该方法直接改变原对象

#用annotate添加注释
#其中有些相近的点,注解会出现重叠,难以看清,需要一些技巧来控制。
#以下参数都是经过调试的,需要具体问题具体调试。
for i in range(len(x)): 
  if i>0:
    plt.annotate(y[i], xy = (x[i],y[i]), xytext=(x[i]+0.05 -0.8/(y[i]-y[i-1]),y[i]))
  else:
    plt.annotate(y[i], xy = (x[i],y[i]), xytext=(x[i]+0.08,y[i]))

plt.show() #展示箱线图

1个回答

boxplot里有个flierprops的属性,如下更改


plt.figure() #建立图像
p = data.boxplot(return_type='dict',flierprops=dict(markerfacecolor='g', marker='+')) #画箱线图,直接使用DataFrame的方法

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
将matplotlib嵌入到C#的GUI中

需要在C#中绘制图表,图表还是可以拖动,放大缩小的那种,python的matplotlib包含了这些功能,所以想将matplotlib嵌入到C#的GUI中,我是C#新手,这是老师给的任务,求C#大佬们帮忙。 下图是matplotlib绘制图表的示例图: ![图片说明](https://img-ask.csdn.net/upload/201711/08/1510146565_971019.png)

python的matplotlib中根据分类选取不同标记

正在做聚类问题,在聚类之后想根据不同的label,采用圆圈,x,+,三角形等符号表示不同的类别画出,求帮助

matplotlib词云和饼状图的标注问题

为啥词云的左上角会出现饼状图的标注,怎么去掉词云这部分的标注,还有饼状图柱状图和词云函数的调用顺序也会影响最后绘制出来的图片,这是为什么??? import pymongo import snownlp as sn import matplotlib.pyplot as plt import numpy as np import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * import jieba from os import path from PIL import Image from wordcloud import WordCloud bg = np.array(Image.open("./data/233.jpg")) d = path.dirname(__file__) stopwords_path = './data/stop_word.txt' text_path = "test.txt" text = open(path.join(d, text_path), encoding='utf-8').read() class filedialogdemo(QWidget): def __init__(self, parent=None): super(filedialogdemo, self).__init__(parent) layout = QHBoxLayout() self.lable1 = QLabel() self.lable1.setPixmap(QPixmap("./data/bar.jpg")) layout.addWidget(self.lable1) self.lable2 = QLabel() self.lable2.setPixmap(QPixmap("./data/pie.jpg")) layout.addWidget(self.lable2) self.lable3 = QLabel() self.lable3.setPixmap(QPixmap("./data/WordCloud.png")) layout.addWidget(self.lable3) self.setLayout(layout) self.setWindowTitle("Result") def sentiment(text): if text == '': return 0.5 else: s = sn.SnowNLP(text) return s.sentiments def Paint_Bar(num1, num2, num3, num4): plt.rcParams['font.sans-serif'] = ['SimHei'] #显示中文 plt.bar(0.125, num1,width=0.1, label='really bad') plt.bar(0.375, num2,width=0.1, label='bad') plt.bar(0.625, num3,width=0.1, label='good') plt.bar(0.875, num4,width=0.1, label='really good') plt.text(0.125, num1 + 0.5, '%d' % num1, ha='center', va='bottom') plt.text(0.375, num2 + 0.5, '%d' % num2, ha='center', va='bottom') plt.text(0.625, num3 + 0.5, '%d' % num3, ha='center', va='bottom') plt.text(0.875, num4 + 0.5, '%d' % num4, ha='center', va='bottom') plt.xlabel(u'x轴') plt.ylabel(u'y轴') ax = plt.gca() ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') plt.xlim(0, 1) plt.xticks([0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1]) plt.title(u'柱形图') plt.legend() plt.savefig('./data/bar.jpg') def Paint_Scatter(list): plt.rcParams['font.sans-serif'] = ['SimHei'] # 显示中文 plt.title(u'散点图') list_len = len(list) for list_num in range(list_len): plt.scatter(list[list_num], list[list_num]) def Paint_Pie(num1, num2, num3, num4): list = [] list.append(num1) list.append(num2) list.append(num3) list.append(num4) s = np.max(list) if s == num1: k = 0 elif s == num2: k = 1 elif s == num3: k = 2 else: k = 3 explode = [0,0,0,0] explode[k] = 0.1 labels = 'really bad', 'bad', 'good', 'really good' plt.axes(aspect=1) #椭圆变标准圆 plt.pie(x=list, explode=explode, labels=labels, autopct='%3.1f %%', shadow=True, labeldistance=1.1, startangle=90, pctdistance=0.6) plt.axis('equal') plt.savefig('./data/pie.jpg') def JiebaClearText(text): MywordList = [] seg_list = jieba.cut(text, cut_all=False) listStr = '/'.join(seg_list) f_stop = open(stopwords_path, encoding='utf-8') try: f_stop_text = f_stop.read() finally: f_stop.close() f_stop_seg_list = f_stop_text.split("\n") for myword in listStr.split('/'): if not(myword.split()) in f_stop_seg_list and len(myword.strip()) > 1: MywordList.append(myword) return ' '.join(MywordList) def Paint_cloud(): text1 = JiebaClearText(text) wc = WordCloud(background_color="white", max_words=150, mask=bg, # 设置图片的背景 max_font_size=60, random_state=42, font_path='C:/Windows/Fonts/simkai.ttf' # 中文处理,用系统自带的字体 ).generate(text1) plt.imshow(wc, interpolation="bilinear") plt.axis("off") plt.savefig('./data/WordCloud.png') def run(): num1 = 0 num2 = 0 num3 = 0 num4 = 0 list0 = [] mongo_uri = 'mongodb://localhost:27017/' client = pymongo.MongoClient(mongo_uri) db = client.weibo collection = db.weibo data = collection.find() data = list(data) list_len = int(len(data)) f = open('test.txt', 'w', encoding='utf-8') for num in range(list_len): dict = data[num] text = dict['content'] f.write(text) if text != ':' and text != 0: text_num = sentiment(text) list0.append(text_num) if text_num < 0.25: num1 += 1 elif text_num < 0.5: num2 += 1 elif text_num <0.75: num3 += 1 else: num4 += 1 f.close() Paint_Bar(num1, num2, num3, num4) #柱形图 Paint_Pie(num1, num2, num3, num4) #饼状图 Paint_cloud() #词云 app = QApplication(sys.argv) ex = filedialogdemo() ex.show() sys.exit(app.exec_()) if __name__ == '__main__': run() ![图片说明](https://img-ask.csdn.net/upload/201904/24/1556093276_144225.png)

如何在jupter中设置matplotlib的中文字体

在jupter中用matplotlib画图,先做了一些基本配置,如下图: ![图片说明](https://img-ask.csdn.net/upload/202006/04/1591261074_830238.jpg) 字体设置为“SimHei”,也尝试了其他好几种字体,但是画图时中文还是显示框框,如下图: ![图片说明](https://img-ask.csdn.net/upload/202006/04/1591261159_195924.jpg) 有解决的办法吗?

vs中使用python操作matplotlib时发生错误

如图(已安装matplotlib) ![图片说明](https://img-ask.csdn.net/upload/201907/25/1564044792_591792.png)

无法在脚本中导入matplotlib

<div class="post-text" itemprop="text"> <p>I am working on a project that involved generating charts of information automatically, as well as other analytical information. In order to accomplish that, I have a set of scripts called automatically from one main script. One of these, generating all the charts, is named <code>analysis.py</code>, utilizing the matplotlib library. But for some reason, it is not running.</p> <p>Here is the beginning of the file where I import matplotlib:</p> <pre><code>#!/usr/bin/python import csv from datetime import datetime import numpy as np import convert from itertools import groupby import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages </code></pre> <p>Whenever I run this script manually in the shell, it works just fine:</p> <pre><code>root@ubuntu:/var/www/Project$ python /var/www/Project/analysis.py root@ubuntu:/var/www/Project$ </code></pre> <p>Also, when I import matplotlib manually it also works fine:</p> <pre><code>root@ubuntu:/var/www/Project$ python Python 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import matplotlib.pyplot as plt &gt;&gt;&gt; from matplotlib.backends.backend_pdf import PdfPages &gt;&gt;&gt; </code></pre> <p>But whenever <code>analysis.py</code> is called from whatever locations (PHP script, another python script, etc.) it fails at the import statmenet for matplotlib. It doesn't return any error message (or I don't know how to access them), but I have isolated the error occurs at the import statment for matplotlib by trial and error.</p> <p>So why doesn't matplotlib import in some situations, and how do I work around it?</p> <p><strong>Update:</strong></p> <p>I have discovered that calling the script from php and python produces problems for different reasons. From php, I used this script here:</p> <pre><code>$input = 'python /var/www/Project/analysis.py'; $command = escapeshellcmd($input); $output = shell_exec($command); echo '&lt;pre&gt;'.$output.'&lt;/pre&gt;'; </code></pre> <p>This is where the script failed to import the library matplotlib in the <code>analysis.py</code>. This is true even when I called <code>analysis.py</code> from a different python script (<code>test.py</code>), which in turn is called in the php.</p> <p>But when I run <code>test.py</code> directly:</p> <pre><code>import os command = "python /var/www/Project/analysis.py" os.system(command) </code></pre> <p>This time the matplotlib imports, but a different problem occurs. Whenever I try to read a particular file, it returns an empty string:</p> <pre><code>with open("/var/www/Project/profile_data.txt") as csvfile: reader = csv.reader(csvfile) next(reader) </code></pre> <p>Because I get this error:</p> <pre><code>next(reader) StopIteration </code></pre> <p>Which means the file is empty, when it clearly isn't.</p> </div>

matplotlib模块有问题,重装了也没用?

错误提示 Traceback (most recent call last): File "**", line 13, in <module> import matplotlib.pyplot as plt File "C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\matplotlib\pyplot.py", line 32, in <module> import matplotlib.colorbar File "C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\matplotlib\colorbar.py", line 28, in <module> import matplotlib.artist as martist File "C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\matplotlib\artist.py", line 11, in <module> from .path import Path File "C:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\matplotlib\path.py", line 17, in <module> from . import _path, rcParams ImportError: cannot import name '_path'

pycharm中matplotlib运行出现问题

![图片说明](https://img-ask.csdn.net/upload/201907/26/1564139533_92790.png) matplotlib版本与pycharm中配置的python版本一致 且Tools一栏中没有Python Scientific的菜单 ![图片说明](https://img-ask.csdn.net/upload/201907/26/1564149853_798004.png)

matplotlib如何做分组条形图??

## matplotlib如何做分组条形图?? ![图片说明](https://img-ask.csdn.net/upload/202002/03/1580722482_16424.png) 这是需要可视化的数据,**想绘制成分组条形图**,下图是通过seaborn实现的效果, ![图片说明](https://img-ask.csdn.net/upload/202002/03/1580722541_765354.png) 有没有大神指导下如何用matplotlib实现??或者使用pandas.plot实现???

Mac下的Anaconda 无法使用matplotlib.pyplot

File "/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py", line 891, in __getitem__ from matplotlib import pyplot as plt File "/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py", line 32, in <module> import matplotlib.colorbar File "/anaconda3/lib/python3.6/site-packages/matplotlib/colorbar.py", line 28, in <module> import matplotlib.artist as martist AttributeError: module 'matplotlib' has no attribute 'artist'

求大佬解答,我用matplotlib绘制的图能在Django web项目中动态显示吗?

我用matplotlib可以生成出图来,怎么把这个图放到Django web项目的页面里,让我打开网页看到的图和直接运行py代码得到的图是一样的效果?求大佬指点一番

在Web应用程序服务器(php)中使用matplotlib时出现问题

<div class="post-text" itemprop="text"> <p>I have a python program that starts with: </p> <pre><code>from optparse import OptionParser import math #import wx import os import numpy as np import matplotlib.pyplot as plt from pylab import * from numpy import * import scipy as scipy from scipy import * from scipy import constants import scipy.signal as signal import matplotlib.pyplot as plt </code></pre> <p>It gives me error when I try to open it with php. I have googled and apparently if I do this before importing pylab or pyplot:</p> <pre><code>import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt </code></pre> <p>Problem should be solved. But the error I get is:</p> <pre><code> /usr/lib/pymodules/python2.7/matplotlib/__init__.py:923: UserWarning: This call to matplotlib.use() has no effect because the the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time </code></pre> <p>Any idea what's going on??</p> </div>

请教:为什么matplotlib中dpi的设置影响图片尺寸?

我设置figsize为6.4 * 6.4英寸,那么输出的尺寸应该是边长为6.4英寸的正方形吧? 但把dpi设为10,输出的图片尺寸小的可怜,这是为什么呢? dpi不应该只是影响图片质量而不是尺寸吗?

matplotlib绘制直方图不显示横坐标值

``` from matplotlib import pyplot as plt import matplotlib matplotlib.rcParams['font.sans-serif']=['SimHei'] # 用黑体显示中文 matplotlib.rcParams['axes.unicode_minus']=False # 正常显示负号 import numpy as np score_array = np.array(score_list) plt.hist(score_array, bins=10) plt.xlabel("区间") plt.ylabel("数量") plt.show() ``` ![图片说明](https://img-ask.csdn.net/upload/201910/15/1571106982_98227.png) 如图可见,直方图横坐标有一条黑线,百思不得其解,求大神解答,万分感谢

python用matplotlib画K线

import matplotlib.pyplot as plt import matplotlib.finance as mpf with open('SH#600004.txt') as obj: text=obj.readlines() baseinfo=text[0] dayinfo=text[2:-1] date_list =[dayinfo[i].split(',')[0] for i in range(len(dayinfo))] open_list =[dayinfo[i].split(',')[1] for i in range(len(dayinfo))] high_list =[dayinfo[i].split(',')[2] for i in range(len(dayinfo))] low_list =[dayinfo[i].split(',')[3] for i in range(len(dayinfo))] close_list=[dayinfo[i].split(',')[4] for i in range(len(dayinfo))] quotes=zip(date_list,open_list,high_list,low_list,close_list) #N=100 #open_list[:N],high_list[:N],low_list[:N],close_list[:N] fig,ax=plt.subplots() mpf.candlestick_ohlc(ax,quotes,width=0.6,colorup='r',colordown='green') plt.title(baseinfo) plt.xlabel(date_list) plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False #用来正常显示负号 plt.show() **#以下是报错信息 C:\ProgramData\Anaconda3\python.exe G:/python/test/test.py C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py:106: MatplotlibDeprecationWarning: The finance module has been deprecated in mpl 2.0 and will be removed in mpl 2.2. Please use the module mpl_finance instead. warnings.warn(message, mplDeprecation, stacklevel=1) Traceback (most recent call last): File "G:/python/test/test.py", line 18, in <module> mpf.candlestick_ohlc(ax,quotes,width=0.6,colorup='r',colordown='green') File "C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\finance.py", line 737, in candlestick_ohlc alpha=alpha, ochl=False) File "C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\finance.py", line 794, in _candlestick height = open - close TypeError: unsupported operand type(s) for -: 'str' and 'str'** 我搜了下知道日期格式转换需要用到date2num这个函数 我的文本里面日期格式是XXXX/XX/XX的形式 请问quotes一项里日期需求的格式是什么?

如何使用matplotlib生成如下热力图

![图片说明](https://img-ask.csdn.net/upload/201805/02/1525267299_368018.jpg) 如上图,要求有标题,横纵坐标都为字母,右边有热力图图例,总之越像越好。最好标题和横纵坐标都和上图一致,中间的数据以列表形式给出,代码中多加点注释,我好理解一点。本人新手,以前没接触过绘图,知道很麻烦各位大神,请大神见谅。谢谢! 其实关于matplotlib生成热力图的问题我也看过不少,但好像没有完全能用的。我看到有个相似的代码如下,但缺少右边的colorbar,请问大神如何修改代码添加colorbar?: import matplotlib.pyplot as plt import numpy as np column_labels = list('ABCD') row_labels = list('WXYZ') data = np.random.rand(4,4) fig, ax = plt.subplots() heatmap = ax.pcolor(data, cmap=plt.cm.Blues) ax.set_xticks(np.arange(data.shape[0])+0.5, minor=False) ax.set_yticks(np.arange(data.shape[1])+0.5, minor=False) ax.invert_yaxis() ax.xaxis.tick_top() ax.set_xticklabels(row_labels, minor=False) ax.set_yticklabels(column_labels, minor=False) plt.show()

用matplotlib设置横坐标为日期时出现问题

在学习《python从入门到实践》第16章时画气温图时出现如下问题 如图![图片说明](https://img-ask.csdn.net/upload/201811/17/1542440700_544980.png) 代码如下: import csv from datetime import datetime import matplotlib.dates as mdates from matplotlib import pyplot as plt # 从文件中获取最高气温 filename = 'death_valley_2014.csv' with open(filename) as f: reader = csv.reader(f) header_row = next(reader) dates, highs, lows = [], [], [] for row in reader: try: current_date = datetime.strptime(row[0], "%Y-%m-%d") high = int(row[1]) low = int(row[3]) except ValueError: print(current_date, 'missing data') else: dates.append(current_date) highs.append(high) lows.append(low) # 根据数据绘制图形 fig = plt.figure(dpi=128, figsize=(10, 6)) plt.plot(dates, highs, c='red', alpha=0.5) plt.plot(dates, lows, c='blue', alpha=0.5) plt.fill_between(dates, highs, lows, facecolor='blue', alpha=0.1) # 设置图形的格式 plt.title("Daily high and low temperatures - 2014\nDeath Valley", fontsize=24) plt.xlabel('', fontsize=20) plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d')) plt.gca().xaxis.set_major_locator(mdates.DayLocator()) fig.autofmt_xdate() plt.ylabel("Temperature(F)", fontsize=16) plt.ylim((10, 120)) plt.tick_params(axis='both', which='major', labelsize=16) plt.show()

matplotlib中add_subplot出错

以下代码是天文包astroML中的例子,运行时出错,调试发现是 一起 fig = plt.figure(figsize=(5, 1.66)) 与 ax = fig.add_subplot(131) 一起运行时出错。但不知道为什么? 还有很奇怪的时以前可以运行的代码,在运行完下面代码出错后,在运行也会出同样的错误 代码: ``` """ EM example: Gaussian Mixture Models ----------------------------------- Figure 6.6 A two-dimensional mixture of Gaussians for the stellar metallicity data. The left panel shows the number density of stars as a function of two measures of their chemical composition: metallicity ([Fe/H]) and alpha-element abundance ([alpha/Fe]). The right panel shows the density estimated using mixtures of Gaussians together with the positions and covariances (2-sigma levels) of those Gaussians. The center panel compares the information criteria AIC and BIC (see Sections 4.3.2 and 5.4.3). """ # Author: Jake VanderPlas # License: BSD # The figure produced by this code is published in the textbook # "Statistics, Data Mining, and Machine Learning in Astronomy" (2013) # For more information, see http://astroML.github.com # To report a bug or issue, use the following forum: # https://groups.google.com/forum/#!forum/astroml-general from __future__ import print_function import numpy as np from matplotlib import pyplot as plt from sklearn.mixture import GaussianMixture from astroML.datasets import fetch_sdss_sspp from astroML.utils.decorators import pickle_results from astroML.plotting.tools import draw_ellipse #---------------------------------------------------------------------- # This function adjusts matplotlib settings for a uniform feel in the textbook. # Note that with usetex=True, fonts are rendered with LaTeX. This may # result in an error if LaTeX is not installed on your system. In that case, # you can set usetex to False. if "setup_text_plots" not in globals(): from astroML.plotting import setup_text_plots setup_text_plots(fontsize=8, usetex=True) #------------------------------------------------------------ # Get the Segue Stellar Parameters Pipeline data data = fetch_sdss_sspp(cleaned=True) X = np.vstack([data['FeH'], data['alphFe']]).T # truncate dataset for speed X = X[::5] #------------------------------------------------------------ # Compute GaussianMixture models & AIC/BIC N = np.arange(1, 14) @pickle_results("GMM_metallicity.pkl") def compute_GaussianMixture(N, covariance_type='full', max_iter=1000): models = [None for n in N] for i in range(len(N)): print(N[i]) models[i] = GaussianMixture(n_components=N[i], max_iter=max_iter, covariance_type=covariance_type) models[i].fit(X) return models models = compute_GaussianMixture(N) AIC = [m.aic(X) for m in models] BIC = [m.bic(X) for m in models] i_best = np.argmin(BIC) gmm_best = models[i_best] print("best fit converged:", gmm_best.converged_) print("BIC: n_components = %i" % N[i_best]) #------------------------------------------------------------ # compute 2D density FeH_bins = 51 alphFe_bins = 51 H, FeH_bins, alphFe_bins = np.histogram2d(data['FeH'], data['alphFe'], (FeH_bins, alphFe_bins)) Xgrid = np.array(list(map(np.ravel, np.meshgrid(0.5 * (FeH_bins[:-1] + FeH_bins[1:]), 0.5 * (alphFe_bins[:-1] + alphFe_bins[1:]))))).T log_dens = gmm_best.score_samples(Xgrid).reshape((51, 51)) #------------------------------------------------------------ # Plot the results fig = plt.figure(figsize=(5, 1.66)) fig.subplots_adjust(wspace=0.45, bottom=0.25, top=0.9, left=0.1, right=0.97) # plot density ax = fig.add_subplot(131) ax.imshow(H.T, origin='lower', interpolation='nearest', aspect='auto', extent=[FeH_bins[0], FeH_bins[-1], alphFe_bins[0], alphFe_bins[-1]], cmap=plt.cm.binary) ax.set_xlabel(r'$\rm [Fe/H]$') ax.set_ylabel(r'$\rm [\alpha/Fe]$') ax.xaxis.set_major_locator(plt.MultipleLocator(0.3)) ax.set_xlim(-1.101, 0.101) ax.text(0.93, 0.93, "Input", va='top', ha='right', transform=ax.transAxes) # plot AIC/BIC ax = fig.add_subplot(132) ax.plot(N, AIC, '-k', label='AIC') ax.plot(N, BIC, ':k', label='BIC') ax.legend(loc=1) ax.set_xlabel('N components') plt.setp(ax.get_yticklabels(), fontsize=7) # plot best configurations for AIC and BIC ax = fig.add_subplot(133) ax.imshow(np.exp(log_dens), origin='lower', interpolation='nearest', aspect='auto', extent=[FeH_bins[0], FeH_bins[-1], alphFe_bins[0], alphFe_bins[-1]], cmap=plt.cm.binary) ax.scatter(gmm_best.means_[:, 0], gmm_best.means_[:, 1], c='w') for mu, C, w in zip(gmm_best.means_, gmm_best.covariances_, gmm_best.weights_): draw_ellipse(mu, C, scales=[1.5], ax=ax, fc='none', ec='k') ax.text(0.93, 0.93, "Converged", va='top', ha='right', transform=ax.transAxes) ax.set_xlim(-1.101, 0.101) ax.set_ylim(alphFe_bins[0], alphFe_bins[-1]) ax.xaxis.set_major_locator(plt.MultipleLocator(0.3)) ax.set_xlabel(r'$\rm [Fe/H]$') ax.set_ylabel(r'$\rm [\alpha/Fe]$') plt.show() ```

无法安装python的matplotlib包,急用求助

![图片说明](https://img-ask.csdn.net/upload/201912/06/1575640274_849869.png) 如图,求助如何安装matplotlib包?

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

立方体线框模型透视投影 (计算机图形学实验)

计算机图形学实验 立方体线框模型透视投影 的可执行文件,亲测可运行,若需报告可以联系我,期待和各位交流

2019 AI开发者大会

2019 AI开发者大会

组成原理课程设计(实现机器数的真值还原等功能)

实现机器数的真值还原(定点小数)、定点小数的单符号位补码加减运算、定点小数的补码乘法运算和浮点数的加减运算。

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

软件测试2小时入门

软件测试2小时入门

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

计算机图形学-球的光照模型课程设计

计算机图形学-球的光照模型,有代码完美运行,有课程设计书

Linux常用命令大全(非常全!!!)

Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错。我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短小但却功能强大。我将我了解到的命令列举一下,仅供大家参考: 系统信息 arch 显示机器的处理器架构 uname -m 显示机器的处理器架构 uname -r 显示正在使用的内核版本 d...

因为看了这些书,我大二就拿了华为Offer

四年了,四年,你知道大学这四年我怎么过的么?

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

fakeLocation13.5.1.zip

fakeLocation13.5.1 虚拟定位 ios13.5.1的最新驱动下载,iPhone/iPad免越狱虚拟定位工具Location-cleaned驱动已更新

UnityLicence

UnityLicence

Python可以这样学(第一季:Python内功修炼)

Python可以这样学(第一季:Python内功修炼)

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

土豆浏览器

土豆浏览器可以用来看各种搞笑、电影、电视剧视频

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

php+mysql学生成绩管理系统

学生成绩管理系统,分三个模块:学生,教师和管理员。 管理员模块:负责学生、老师信息的增删改;发布课程信息的增删改,以便让学生选课;审核老师提交的学生成绩并且打印成绩存档;按照课号查询每个课号的学生成绩

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

推荐24个国外黄色网站欣赏

在中国清朝,明黄色的衣服只有皇子才有资格穿,慢慢的黄色在中国就成了高贵的颜色。在人们的色彩印象中,黄色也表现为暂停。所以当你的网页设计采用黄色的时候,会让人们在你的网页前停留。 黄色,就像橙色和红色,黄色也是一个暖色。它有大自然、阳光、春天的涵义,而且通常被认为是一个快乐和有希望的色彩。黄色是所有色相中最能发光的颜色,给人轻快,透明,辉煌,充满希望的色彩印象。 黄色是一个高可见的色...

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

C++语言基础视频教程

C++语言基础视频教程

玩转Python-Python3基础入门

玩转Python-Python3基础入门

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行
立即提问