我想使用gnuplot在同一个窗口上一个接一个地绘制一系列图像。图像具有完全相同的大小,我有许多按顺序称为test_0X.gnu,并且采用gnuplot格式。
我是用bash写的。
ctrl+z
seq -f确保在数字之前存在正确数量的填充零。
这有效,但是一旦脚本启动,我无法阻止它,因为 public void getDrawingBitmap() throws Exception{
LinearLayout tabLayout = (LinearLayout)findViewById(R.id.screen_shot_layout);
if (tabLayout != null) {
Bitmap image = Bitmap.createBitmap(tabLayout.getWidth(),
tabLayout.getHeight(), Config.ARGB_8888);
Canvas b = new Canvas(image);
tabLayout.draw(b);
if (image!=null) {
// here is your sceenshot
}else{
Toast.makeText(DashBord.this, "Unabel to take screen shot", Toast.LENGTH_LONG).show();
}
}
}
或{{1}}不起作用,并且由于不断出现pdf窗口,我无法访问其他终端。 / p>
答案 0 :(得分:2)
只需写一个简短的gnuplot脚本
console.log("content script!")
function getIconSpanIfExists() {
var spanClassName = "imagePoi";
var matchingElements = document.getElementsByClassName(spanClassName);
if (matchingElements.length > 1) {
console.error(failureMessage("wasn't expecting more than one element with class name " + spanClassName));
return null;
}
if (matchingElements.length === 0) {
return null;
}
return matchingElements[0].parentNode;
}
function htmlReady() {
return getIconSpanIfExists();
}
function addIcons() {
var iconSpan = getIconSpanIfExists();
// Append into body - works.
// var icon = document.createElement("img");
// icon.id = "seenIcon";
// icon.src = chrome.extension.getURL("seen.png");
// document.body.appendChild(icon);
// console.log("appended " + icon.id + " into body");
// Append into span - doesn't work, even though it says childNodes.length is 2.
var icon = document.createElement("img");
icon.id = "seenIcon";
icon.src = chrome.extension.getURL("seen.png");
icon.style.left = "200px";
icon.style.top = "200px";
iconSpan.appendChild(icon);
console.log("appended " + icon.id + " into span with class imagePoi" + " new children: " + iconSpan.childNodes.length);
// Modify innerHTML of span - doesn't work, even though innerHTML has the icon.
// iconSpan.innerHTML += "\n<img id=\"seenIcon\""
// + "src=\"" + chrome.extension.getURL("seen.png") + "\""
// + "style=\"left: 200px; top: 200px;\">";
// console.log(iconSpan.parentNode.id, iconSpan.innerHTML);
}
function init() {
console.log("initialising content script");
if (!htmlReady()) {
console.log("not all HTML is loaded yet; waiting");
var timer = setInterval(waitForHtml, 200);
function waitForHtml() {
console.log("waiting for required HTML elements...");
if (htmlReady()) {
clearInterval(timer);
console.log("... found them!");
addIcons();
}
}
return;
}
}
if (document.readyState === "complete") {
console.log("document is complete")
init();
} else {
console.log("document is not yet ready; adding listener")
window.addEventListener("load", init, false);
}
并运行此
答案 1 :(得分:1)
gnuplots“gif”终端可以制作现成的动画。
skip=5 # change as needed
set term gif animate 10 # 10/100 s delay between frames
set out "test.gif"
# assuming your data files are named "test_0001.dat" etc.
do for [i=1:100:skip] {plot sprintf("test_%04.f.dat",i)}
set out