简体   繁体   English

matplotlib savefig中的区分大小写

[英]Case sensitivity in matplotlib savefig

while creating and saving plots of different parameter combinations in matplotlib I noticed a very weird behaviour regarding case sensitivity in the savefig function. 在matplotlib中创建和保存不同参数组合的图时,我注意到在savefig函数中关于区分大小写的一种非常奇怪的行为。 The following example 以下示例

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0,10)
y = np.linspace(0,10)
plt.plot(x,y)
plt.savefig("test.pdf")

x = np.linspace(0,20)
y = np.linspace(0,20)
plt.plot(x,y)
plt.savefig("TEST.pdf")

will produce a single file named test.pdf which contains the range from 0 to 20. I assume this is because some overwrite check is not case sensitive and changes the export name. 将生成一个名为test.pdf的文件,其中包含0到20的范围。我假设这是因为某些覆盖检查不区分大小写并更改导出名称。

Do you know if this is intended (propably not) or maybe a mac related issue (OSX 10.11 with homebrew python)? 你知道这是打算(可能不是)或者是mac相关的问题(OSX 10.11与自制的python)吗?

Thanks, nandurius 谢谢,nandurius

File directories are never case sensitive so when it goes to save the TEST.pdf it will overwrite the original test.pdf. 文件目录从不区分大小写,因此当它保存TEST.pdf时,它将覆盖原始的test.pdf。 This is the same on mac as well as windows 在mac和windows上都是一样的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM