草庐IT

concept_labels

全部标签

python - 调整 x_axis_label 或 y_axis_label 字体/字体大小( Bokeh )

有没有办法调整x_axis_label和y_axis_labelBokeh中的字体/字体大小(0.70)?我知道一种使用title_text_font_size调整标题字体大小的方法属性(property),有:figure(...,title_text_font_size="12pt")有没有办法指定类似的内容:figure(...,x_axis_label_text_font_size='10pt')(使用_text_font_size的约定)表示字体大小属性。以上没有工作。如果这不存在,有人可以给出一些关于如何在cofeescript+API端进行此类调整的指示,以便可以回馈项目

Python seaborn facetGrid : Is it possible to set row category label location to the left

当使用SeabornfacetGrid图时。是否可以将行变量标签设置在左侧(例如,作为两行子图y轴标签的第一行)?作为子图标题的一部分,默认位置在顶部。不幸的是,合并的文本有时会变得太长而无法合理地放入那个拥挤的空间。然后我尝试在实例化facetGrid对象时使用margin_titles=True选项。但在这种情况下,行变量标签位于图例右侧的外侧,这可能离图表太远了。因此,在我的两分钱思想中,提高美感的可能简单方法:当margin_titles=True和legend_out=True时,将边距标题移动到图例中允许行变量标签显示在y轴标签之前的左侧。其他想法?抱歉,积分不够,无法添加

python - "ValueError: labels [' 时间戳 '] not contained in axis"错误

我有这段代码,我想从文件中删除“时间戳”列:u.data但不能。它显示错误“ValueError:标签['timestamp']未包含在轴中”我该如何纠正它importnumpyasnpimportpandasaspdimportmatplotlib.pyplotaspltplt.rc("font",size=14)fromsklearn.linear_modelimportLinearRegressionfromsklearn.linear_modelimportRidgefromsklearn.cross_validationimportKFoldfromsklearn.cross

python - Matplotlib 数学文本 : Glyph errors in tick labels

我在matplotlib2.0.2中使用默认mathtext渲染数学时观察到错误而不是LaTeX数学渲染引擎。数学文本似乎无法识别某些字形(在我的例子中是减号和乘号)。真正奇怪的是,只有当这些特定字形出现在刻度标签中时才会发生错误。当我故意输入一些数学表达式时图标题,它工作正常。考虑下面的示例和生成的图像:importmatplotlibimportmatplotlib.pyplotasplt#Customizematplotlibmatplotlib.rcParams.update({#Usemathtext,notLaTeX'text.usetex':False,#UsetheCo

python - 模型类未声明显式 app_label 并且不在 INSTALLED_APPS 的应用程序中

我正在使用sphinx并试图为我的Django项目生成文档。我决定首先尝试记录模型,所以在我的.rst文件中我这样做了wdland\.models==============..automodule::wdland.models:members::undoc-members::show-inheritance:但是得到以下错误WARNING:/home/fabou/wdlandenvpy3/source/docs/wdland.rst:9:(WARNING/2)autodoc:failedtoimportmodule'wdland.models';thefollowingexcepti

python - Tensorflow 无效参数 : Assertation Failed [Label IDs must < n_classes]

我在使用Python2.7的Tensorflow1.3.0中实现DNNClassifier时遇到错误。我从Tensorflowtf.estimatorQuickstart教程中获得了示例代码,我想使用我自己的数据集运行它:3D坐标和10个不同的类(int标签)。这是我的实现:#!/usr/bin/envpython#-*-coding:utf-8-*-defReadLabels(file):#loadthelabelsfromtestfileherelabelFile=open(file,"r")Label=labelFile.readlines();returnL=[[Label[i

python - "NotImplementedError: Use label() to access a node label"

我需要从网站中提取所有城市名称。我在以前的项目中使用了beautifulSoup和RE,但在这个网站上,城市名称是常规文本的一部分,没有特定的格式。我找到了满足我要求的地理包(https://pypi.python.org/pypi/geograpy/0.3.7)。地理学使用nltk包。我为nltk安装了所有模型和包,但它一直抛出这个错误:>>>importgeograpy>>>places=geograpy.get_place_context(url="http://www.state.gov/misc/list/")Traceback(mostrecentcalllast):Fil

python + matplotlib : how to insert more space between the axis and the tick labels in a polar chart?

我正在尝试使用matplotlib和python2.7制作极坐标图,但我正在努力研究如何增加同一轴的X轴和刻度标签之间的空间。正如您在图片上看到的,12:00和6:00的标签看起来很好,我希望所有其他标签都有相同的空间。我试过ax.xaxis.LABELPAD=10但是没有任何效果。这是我的代码(抱歉弄得一团糟......):importnumpyasnpimportmatplotlibasmplmpl.use('Agg')importmatplotlib.pyplotaspltimportmatplotlib.datesfrommatplotlib.datesimportYearLo

python 基维 : Align text to the left side of a Label

我阅读了文档,但仍然不知道如何将Kivy-Label中的文本与其左侧对齐。文本默认居中。halign="left"没有帮助。抱歉,如果解决方案很明显,但我就是找不到。编辑:示例代码:fromkivy.appimportAppfromkivy.uix.floatlayoutimportFloatLayoutfromkivy.uix.labelimportLabelclassExample(App):defbuild(self):self.root=FloatLayout()self.label=Label(text="I'mcentered:(",pos=(0,0),size_hint=

Python Pandas Group By 错误 'Index' 对象没有属性 'labels'

我收到这个错误:'Index'objecthasnoattribute'labels'回溯看起来像这样:Traceback(mostrecentcalllast):File"",line1,indf_top_f=k.groupby(['features'])['features'].count().unstack('features')File"C:\Anaconda3\lib\site-packages\pandas\core\series.py",line2061,inunstackreturnunstack(self,level,fill_value)File"C:\Anacon