我正在寻找一个命令行工具(用于linux)来生成数据文件中的图.我一开始尝试使用gnuplot但它的曲线拟合能力并不是那么好.
然后我尝试了R但是我找不到一种方法来写一个矢量(标志上的小箭头)或热平均值(LaTeX中的\ left\langle\right\rangle).
我有一些隐藏的插件,我找不到任何完成任务的人?
我最近注意到了这一点,我不知道这是一个与Linux Linux或Emacs有关的问题.
如果我在远程计算机上找到一个文件,然后我将其打开并执行任何操作,当我返回该文件时,Emacs不响应.我发现的唯一解决方案是杀死Emacs并重新打开它.
有没有更人性化的方法来做到这一点?
我在matplot lib中创建了一个图,我希望在该图中添加一个插图.我希望绘制的数据保存在我在其他图中使用的字典中.我在循环中找到了这个数据,然后我再次为子图运行这个循环.以下是相关部分:
leg = []
colors=['red','blue']
count = 0
for key in Xpr: #Xpr holds my data
#skipping over what I don't want to plot
if not key[0] == '5': continue
if key[1] == '0': continue
if key[1] == 'a': continue
leg.append(key)
x = Xpr[key]
y = Ypr[key] #Ypr holds the Y axis and is created when Xpr is created
plt.scatter(x,y,color=colors[count],marker='.')
count += 1
plt.xlabel(r'$z/\mu$')
plt.ylabel(r'$\rho(z)$')
plt.legend(leg)
plt.xlim(0,10)
#Now I wish to create the inset
a=plt.axes([0.7,0.7,0.8,0.8])
count = 0
for …Run Code Online (Sandbox Code Playgroud) 我想要曲线旁边的箭头。例如:
import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(0,4*np.pi,10000)
Y = np.sin(X)
shift = 0.1
seg_size = 300
i = 0
plt.plot(X,Y,color='blue')
while i +seg_size < len(X):
x = X[i:i+seg_size]
y = Y[i:i+seg_size]+shift
plt.plot(x,y,color='black')
#input here command for arrow head
i += seg_size*2
plt.show()
Run Code Online (Sandbox Code Playgroud)
我试图计算曲线末端线的下一个角度并绘制箭头线,但我做错了,箭头变形了。任何提示?
我正在尝试使用boost中的共享指针类(?).我已经下载了boost并将其解压缩到源文件夹(src)中的子文件夹(boost).然后我添加了一行:
#include "boost/shared_ptr.hpp"
Run Code Online (Sandbox Code Playgroud)
当我尝试编译时,我收到一个错误:
错误:boost/smart_ptr/shared_ptr.hpp:没有这样的文件或目录
我需要为程序编译添加什么?
我正在研究一台没有root权限的科学linux机器
我想了解kivy.安装完成后,启动kivy,我收到一条消息,说我应该先创建一个项目/mny/sdcard/kivy.该文件夹不存在,所以我通过FTP连接创建它.然后我将main.py文件放在子文件夹中.再次启动kivy(迫使它关闭后)产生相同的结果.我错过了什么?
我正在关注 python 挑战谜语,现在我需要分析一个 wav 文件。我了解到有一个 python 模块可以读取帧,这些帧是 16 位或 8 位。
我不明白的是,这些位代表什么?这些值是否直接转换为施加到扬声器的电压(例如通过因式分解)?
我现在已经挣扎了好几天了.
我想创建一个遍历目录的函数,选择扩展名为*.csv的所有文件并读取其中的数据.
我创建了一个函数,通过检查字符串以.csv结尾来检查合法的每个文件名.为此,我想转到char*数组的末尾.我试过这个:
char * point = file_name;
while (point != "\0"){
point += 1;
}
Run Code Online (Sandbox Code Playgroud)
它通过char*数组而没有找到和"\ 0".
如果我写
*point != "\0"
Run Code Online (Sandbox Code Playgroud)
编译器警告我,我正在将char和int进行比较.
我应该注意到我使用了文件名
dirent->d_name
Run Code Online (Sandbox Code Playgroud) 在我的Android代码中,我给GUI充气并将所有子元素存储在不同的类中.在该类中,我想添加一个方法来读取用户输入.我尝试按照这个链接中的内容进行操作,但无论我做什么,它都归结为将最终值复制到非最终值.我虽然想创造另一个gui但是无法用这种方式来制作.这是我现在的方法:
private String setText(int id){
AlertDialog.Builder alert = new AlertDialog.Builder(this.show);
final EditText input = new EditText(this.show);
alert.setView(input);
String out;
alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
//@Override
public void onClick(DialogInterface dialog, int which) {
Editable value = input.getText();
out = value.toString();
// TODO Auto-generated method stub
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
我用它来将一个字符串返回到另一个设置值的方法TextView.
我试着做以下几招:
private String setText(){
AlertDialog.Builder alert = new AlertDialog.Builder(this.show);
final EditText input = new EditText(this.show);
alert.setView(input);
String out;
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用fit命令行在Matlab中拟合曲线.输入数据是:
X =
1
2
4
5
8
9
10
13
Y =
1.0e-04 *
0.1994
0.0733
0.0255
0.0169
0.0077
0.0051
0.0042
0.0027
Run Code Online (Sandbox Code Playgroud)
目标函数是
Y = 1/(kappa*X.^a)
Run Code Online (Sandbox Code Playgroud)
我正在使用fittype,fitoptions并且fit如下:
model1 = fittype('1/(kappa*x.^pow)');
opt1 = fitoptions(model1);
opt1.StartPoint = [1e-5 -2];
[fit1,gof1] = fit(X,Y.^-1,model1,opt1)
Run Code Online (Sandbox Code Playgroud)
我得到的结果rsquare大约是-450,与测量的方向相同.
.如何提高Matlab的拟合技巧?
编辑:
我删除了.^-1fit命令.这改善了行为,但并不完全正确.如果我将model1设置为:
model1 = fittype('1/(kappa*x.^pow)');
Run Code Online (Sandbox Code Playgroud)
适合不好.如果我将它设置为:
model1 = fittype('kappa*x.^pow');
Run Code Online (Sandbox Code Playgroud)
拟合是好的(kappa是一个非常小的数字,而pow是负的).
我也正常化了Y,我得到了一个合理的结果