标签: matplotlib

更新 conda 包时出错:RemoveError: 'setuptools' is a dependency of conda

当我遇到以下错误时,我需要更新 matplotlib:

conda update matplotlib
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/gpu-server/anaconda3

  added / updated specs:
    - matplotlib


The following NEW packages will be INSTALLED:

  libopenblas        pkgs/main/linux-64::libopenblas-0.3.3-h5a2b251_3
  setuptools         pkgs/main/linux-64::setuptools-40.6.3-py37_0

The following packages will be UPDATED:

  matplotlib                conda-forge::matplotlib-3.0.0-2 --> pkgs/main::matplotlib-3.0.2-py37h5429711_0
  numpy              conda-forge::numpy-1.15.1-py36_blas_o~ --> pkgs/main::numpy-1.15.4-py37h99e49ec_0
  numpy-base                          1.15.3-py36h81de0dd_0 --> 1.15.4-py37h2f8d375_0
  pyparsing          conda-forge/noarch::pyparsing-2.2.2-p~ --> pkgs/main/linux-64::pyparsing-2.3.1-py37_0
  python                                   3.6.8-h0371630_0 --> 3.7.2-h0371630_0
  pytz                 conda-forge/noarch::pytz-2018.6-py_0 --> pkgs/main/linux-64::pytz-2018.9-py37_0
  six                     conda-forge::six-1.11.0-py36_1001 --> pkgs/main::six-1.12.0-py37_0
  wheel                    conda-forge::wheel-0.32.2-py36_0 --> pkgs/main::wheel-0.32.3-py37_0

The following packages will be SUPERSEDED …
Run Code Online (Sandbox Code Playgroud)

linux python matplotlib anaconda

14
推荐指数
2
解决办法
2万
查看次数

在 MS Word 中插入高质量数字的最佳方法

我需要一种方法将高质量的 PDF 图形插入到 Word 中而不会使它们变形。

这些图形大多是通过 Python 和 Matplotlib 生成的科学图表。主要问题是图表中的文本标签无法正确呈现。

我知道您可以将 PDF 作为对象插入,将 EPS 文件作为图像插入,但是这些图形在 Word 中的显示效果非常差。

因此,我当前的工作流程是使用 Inkscape 将图形导出为 300DPI 的 PNG 文件。然而,图形质量仍然不能令人满意,当我提高 DPI 时,质量没有明显的提高。

有人知道在Word中插入高质量图表的好方法吗?

pdf microsoft-word matplotlib

6
推荐指数
1
解决办法
2万
查看次数

解析和显示“.csv”文件的最快方法是什么?

我目前正在使用 python 和 matplotlib 来显示 440+ k 行,.csv但只需要11 sec显示一列。我的.csv总是相同的格式。有没有办法更快地解析它?我选择将所有列存储到列表中然后显示它。

这是我制作的代码:

csv_path = "C:/Users/mydata.csv"
csv_database = open(csv_path, delimiters=";")    
data_dict = csv.DictReader(csv_database, delimiter=";")

current_row = 0

number_list = []

for row in data_dict:

   current_row += 1 # Skip heading row

   if current_row == 1:
       continue

   # Here I add to a list of strings already created 
   name_list.append(row["Name"]) # Assuming the header of the column is "Name"

   # Here I add to a list of integer 
   if …
Run Code Online (Sandbox Code Playgroud)

python csv matplotlib

5
推荐指数
1
解决办法
2733
查看次数

_tkinter.TclError:无法连接以在 Windows 上显示“localhost:0.0”matplotlib bash

受到在 Windows 上使用 Bash (Ubuntu) 终端显示 Python 脚本中使用的 matplotlib 的问题的启发,我遵循了第一个答案中列出的说明。然而,重新启动计算机后,突然出现错误:

_tkinter.TclError: couldn't connect to display "localhost:0.0"
Run Code Online (Sandbox Code Playgroud)

您知道如何修复它并显示图像吗?

引用上述帖子,我有:

  1. 下载并安装Xming
  2. sudo apt-get update
  3. sudo apt-get install python3.6-tk
  4. (之前安装了matplotlib)
  5. export DISPLAY=localhost:0.0并添加到 ~/.bashrc

windows bash xming python3 matplotlib

5
推荐指数
1
解决办法
1万
查看次数

无法在 cygwin 中安装 matplotlib(freetype 问题)

在我的 cygwin 环境中拥有 matplotlib 会非常好。我有 64 位 Windows 8 和 64 位 cygwin。

当我输入:

pip install matplotlib
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

 * The following required packages can not be built:
 * freetype
Run Code Online (Sandbox Code Playgroud)

根据 apt-cyg 我已经安装了以下软件包:

Searching for installed packages matching freetype: 
cygwin32-freetype2
freetype2-debuginfo
libfreetype-devel
libfreetype-doc
libfreetype6
Run Code Online (Sandbox Code Playgroud)

它还需要什么?如何正确安装 freetype 和 matplotlib?

windows cygwin 64-bit pip matplotlib

4
推荐指数
1
解决办法
5873
查看次数

无法在 pip 上安装任何东西

每次我尝试在 pip 上安装任何东西时,它都会以以下错误消息结束。

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
Run Code Online (Sandbox Code Playgroud)

具体来说,我尝试了 matplotlib、seaworth 和 pandas。虽然后者在 Windows 控制台中工作,但在 pycharm 包管理器中不起作用。

python pip matplotlib pycharm

4
推荐指数
1
解决办法
5996
查看次数

找不到 OSX 10.8 PIP matplotlib 'freetype/config/ftheader.h' 文件

如果已经讨论过这个话题,我提前道歉。我的情况似乎与其他情况略有不同,因此我的文件路径不同。尝试在 Mac OS X 10.8.5 上安装 matplotlib 时,返回以下错误:

pip install matplotlib
# lots of install details here...
/usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
         ^
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ohMPzS-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/matplotlib
Storing debug log for failure in /Users/administrator/Library/Logs/pip.log
Run Code Online (Sandbox Code Playgroud)

我的 Homebrew 安装了以下内容:

fontconfig
gfortran
jpeg
libtiff
pkg-config
freetype …
Run Code Online (Sandbox Code Playgroud)

python matplotlib macos

3
推荐指数
1
解决办法
3279
查看次数

如何:用于浮动 matplotlib 图形的 bspwm bspc 规则

我最近开始使用 bspwm,我对工作流程的改进感到震惊。然而,有一件事情一直困扰着我:

我正在用 python 编写使用 matplotlib 进行绘图的数据分析脚本。每次绘制绘图时,我的窗口都会重新排列,因为 bspwm 会执行其平铺魔术。通常,我会在配置文件中定义一个 float=True ,但是为此我需要应用程序的名称。像这样的东西:

bspc 规则 -a matplotlib float=on

有人可以告诉我,我如何正确处理 matplotlib 数字?

PS有人可以为bspwm创建一个标签吗?

window-manager matplotlib

2
推荐指数
1
解决办法
3644
查看次数