我想在我的gnuplot数字中获得透明背景.我编码到现在为止:
#! /usr/bin/python
from numpy import *
import Gnuplot as gp
import Gnuplot.funcutils
x = (1,2,3)
y=(2,4,5)
x1 = (3,6,8)
g = gp.Gnuplot()
g("set terminal svg size 200,400")
g("set output 'filename.svg'")
g("unset xtics")
g("unset ytics")
g("set multiplot layout 3,1 title 'Title here'")
g("set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb '#ff0000' behind")
#First
g("set tmargin 2")
g("set title 'Plot'")
g("unset key")
d = gp.Data(x,y,with_="lines")
g.plot(d)
#Secon
g("set title 'Plot2'")
g("unset key")
d1 = gp.Data(x1,y,with_="lines")
g.plot(d1)
#Third …Run Code Online (Sandbox Code Playgroud) 由于深色窗户可以减轻我的眼睛疲劳,因此我想在 gnuplot 终端中设置深色背景。在绘图下方设置一个黑色方块将是一个解决方案,只要这不会影响可读性(深色背景上的黑线......)。
我不想花时间寻找颜色组合,但是通过反转终端颜色,我将得到我所需要的:深色背景和可读的绘图。
有谁知道反转终端的命令,或者支持颜色反转的交互式终端(GNU/Linux 支持)的名称?
提前致谢。
我遇到了无法放大 GNUPLOT 的问题。我创建了一个记录各种资源信息的 bash 脚本,并通过以下命令显示这些信息。
gnuplot -e persist "set title 'Resource monitor' ; set timefmt '%y/%m/%d-%H:%M:%S' ; set xdata time ; set xlabel 'TIME' ; set ylabel 'PERCENT' set yrange [0:101]" -e "plot '${cpuResFile}' using 1:2 title 'CPU' smooth Bezier, '${memResFile}' using 1:2 title 'MEM' smooth Bezier" &
Run Code Online (Sandbox Code Playgroud)
该图形是可见的并显示我想要的信息,我只是不知道如何让它放大和缩小。我读到它与不再设置 X11 窗口有关,或者我需要通过命令行设置它,我只是不知道具体如何设置,或者这是否是原因。希望有几个 GNUPLOT 专家可以帮助我。:)
谢谢你。
以下是我使用的代码,下面是我的输出。我想删除子图和 x 标签之间的所有空格。最后的链接中提供了我需要的样本,唯一的区别是我需要所有盒子的大小相同。
set terminal jpeg
set output "mul.jpeg"
set multiplot
set xr[0:10]
set ylabel "y"
set format y ""
set key off
set size 1,0.25
set origin 0.0,0.0;
set xlabel "x"
plot sin(x)
replot sin(2*x)
set origin 0.0,0.25;
set format x ""
plot cos(x)
replot cos(2*x)
set origin 0.0,0.50;
set format x ""
plot sin(x)
set origin 0.0,0.75;
set format x ""
plot cos(x)
unset multiplot
Run Code Online (Sandbox Code Playgroud)
我真正需要的是这样的:
https://inspirehep.net/record/1345236/files/hada_fig2.png
感谢您的任何帮助!
我使用以下代码绘制该数据的热图
reset
set terminal pngcairo size 800,800
set output 'Temp.png'
#set terminal tikz
#set output 'Temp.tex'
set lmargin at screen 0.05
set rmargin at screen 0.85
set bmargin at screen 0.1
set tmargin at screen 0.9
set palette defined ( 0 '#000090',\
1 '#000fff',\
2 '#0090ff',\
3 '#0fffee',\
4 '#90ff70',\
5 '#ffee00',\
6 '#ff7000',\
7 '#ee0000',\
8 '#7f0000')
set pm3d map interpolate 20,20
unset key
set multiplot
# plot the heatmap
splot '2m_p2_f36.txt' using 1:2:3
unset multiplot
unset output …Run Code Online (Sandbox Code Playgroud) 在我已经使用了自定义设置之后,有什么方法可以重置或使用 xtics(或 ytics)的默认设置?
我需要这样的东西:
set ytics 0.005 nomirror
set y2tics 5 nomirror
plot 'dummy' u 1:2 axes x1y1, dummy2 u 1:2 axes x1y2
##Another plot with "normal" axes
set ytics default (this command doesn't exist but this is what I need)
set y2tics default
plot 'dummy3' u 1:2
Run Code Online (Sandbox Code Playgroud)
因此,如果该命令确实存在,那将解决我的问题,因为我现在拥有的是第二个图当然使用为前一个图定义的 ytics。而且我不想使用重置选项,因为我不想在我的脚本中再次定义所有内容。
非常感谢!
我想用 C++ 程序生成的 (x,y) 点绘制一些图形。我可以从终端从 gnuplot 命令成功绘制这些数据。
但我想从 C++ 程序中绘制同样的东西,这在 ubuntu 16.04 lts 中可能吗?
我正在用 C++ 创建一个(伪)实时绘图应用程序,使用 gnuplot 作为我的绘图后端。我的要求之一是绘图必须在现有窗口内,而不是具有单独的绘图窗口(gnuplot 默认为该窗口)。
Gnuplot 有一个选项来指定 (Qt) 小部件 ID,这似乎适合我的用例:
set terminal qt widget <id>
Run Code Online (Sandbox Code Playgroud)
我尝试在 my 内部传递值QtWidget::effectiveWinId()但无济于事。
更新:尝试使用窗口 id 的内部值也QtWidget::winId()没有运气。
问题是我找不到任何关于<id>应该是什么的文档。这是 gnuplot 的开发人员的意图吗?
这是我的代码示例:
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtNetwork/QLocalSocket>
int main()
{
QApplication app(argc, argv);
QWidget win(nullptr, Qt::Window);
QWidget *window = win.window();
win.show();
std::cout << "effective win id: " << window->effectiveWinId() << "\n";
std::cout << "effective win id: " << win.effectiveWinId() << "\n";
return app.exec();
}
Run Code Online (Sandbox Code Playgroud)
在 gnuplot 中:
gnuplot> …Run Code Online (Sandbox Code Playgroud) 我使用带有 pdfcairo 终端的 gnuplot 5.0 绘制 pdf 图,然后使用 Latex 将该图插入到 pdf 文件中。然而,我发现gunplot中的字体大小与latex中的字体大小不同,尽管我将它们设置为相同。
为了使gnuplot和latex中的字体大小一致,我必须将gnuplot中的字体比例设置为0.75,如以下代码所示。
gnuplot 代码:用蓝色绘制“A”(Helvetica,大小 12,字体比例 0.75)。
set terminal pdfcairo font 'Helvetica,12' size 1cm,1cm fontscale 0.75
set output 'test0.pdf'
set xrange [-1:1]
set yrange [-1:1]
unset xtics
unset ytics
unset border
set label 'A' at 0,0 textcolor 'blue'
p 1/0 notitle
Run Code Online (Sandbox Code Playgroud)
Latex 代码:按原始大小插入前一个数字,并在前一个“A”旁边写一个黑色“A”(Helvetica,尺寸 12)。
\documentclass[12pt]{standalone}
\usepackage{tikz}
\usepackage{helvet}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}
\node at (0,0) {\includegraphics{test0.pdf}};
\node at (0.3, -0.025) {\textsf{A}};
\end{tikzpicture}
\end{document}
Run Code Online (Sandbox Code Playgroud)
您可以在此处查看最终的 pdf 文件。现在我们可以看到,在 gnuplot 设置“fontscale 0.75”下,这两个“A”的大小完全相同。我不明白为什么在 gnuplot 中应该使用“fontscale …
我正在尝试在 gnuplot 中创建一个图,在图例中的符号 theta 上带有点。
我正在寻找类似于乳胶中的 \dot{\theta} 和 \ddot{\theta} 的东西。但是,大多数帖子要求使用输出 .tex 文件的“set term latex”或“set term epslatex”。我需要将输出保留为 pdf,在图例中的 theta 上带有点和双点。这可能吗?感谢任何帮助。谢谢!
代替“音高率”,我需要符号 theta 上面有一个点。代替“俯仰加速度”,我需要上面有两个点的符号 theta。
set term pdf
set termopt enhanced
set encoding utf8
set output "rampfuncs.pdf"
set style func linespoints
set xlabel 'time'
set format y "%.2f"
plot "output.dat" using 1:2 title '{/Symbol q} - Pitch angle', \
"output.dat" using 1:3 title 'Pitch rate', \
"output.dat" using 1:4 title 'Pitch acceleration'
set term x11
Run Code Online (Sandbox Code Playgroud)
从 meuh 回答后更新:图像供参考
来自 meuh 的评论后的第二次更新:图片 2