我想在Tcl/Tk中做简单的图形例程,如散点图,xy图,直方图.我使用的是Tcl/Tk 8.5.7.我发现在Tcler的维基中,很少有选项如BLT在Tcl/Tk 8.5+中不受支持
是否有任何Tcl/Tk接口gnuplot或任何小部件来完成图形化?
请告诉我Tcl/Tk中图形例程的选择.
是gnuplot的新手,但需要紧急使用。这是我使用的以下命令集:
set terminal latex
set output “conflict.tex”
set xtics ("random" 2, "sharing(0%)" 3, "sharing(10%)" 4, "sharing(25%)" 5, “sharing(50%)” 6, “stat” 7)
set ylabel “Conflict Percentage”
set xrange [0:9]
set yrange [0:60]
set xlabel “Traces”
set boxwidth 0.3
set style fill
plot 'D:\Utility Softwares\conflicts.dat' with boxes
Run Code Online (Sandbox Code Playgroud)
之后我得到“格式错误的字符”,不知道为什么
感谢帮助
有两个数据文件,比如data1.txt:
31231
32312
32323
32323
Run Code Online (Sandbox Code Playgroud)
data2.txt:
32323
54223
32456
45321
Run Code Online (Sandbox Code Playgroud)
我想在同一个图上绘制两个图,我怎么gnuplot用来实现呢?非常感谢yu.
我正在从具有以下格式的数据文件中绘制 gnuplot 图表:
01 value_1_1 value_2_1
02 value_1_1 value_2_1
...
01 value_1_n value_2_n
Run Code Online (Sandbox Code Playgroud)
使用该命令:
plot "action.dat" using 2:xtic(1) with boxes ls 1 title "First title",\
"action.dat" using 3:xtic(1) with boxes ls 2 title "Second title";
Run Code Online (Sandbox Code Playgroud)
X tic 标签从第一列加载。当终端太小时,标签开始重叠。如果 x tic 标签与前一个标签重叠,如何隐藏它?或者,至少,我怎样才能只绘制第 n 个标签?
我试过做这样的事情
set xtics 10 rotate by -90
Run Code Online (Sandbox Code Playgroud)
但失败了。
正如标题所示,我想将情节图例放在多图表下方.我为其中一个图添加了图例,因为所有线条样式都相同.我遇到的问题是,如果我添加键set key below,则绘图本身会调整大小以适应画布中的(大)键.我宁愿保持情节的大小.我尝试在多重绘图中添加密钥作为附加图set key inside,但是如果密钥太大,则密钥可以与图重叠.我正在使用epslatex终端.
下载.zip文件后我收到此错误:
Traceback (most recent call last):
File "setup.py", line 15, in <module>
from __init__ import __version__
File "/Users/me/Downloads/gnuplot-py-1.8/__init__.py", line 164, in <module>
from gp import GnuplotOpts, GnuplotProcess, test_persist
ImportError: cannot import name GnuplotOpts
Run Code Online (Sandbox Code Playgroud)
我在我的机器上安装了gnuplot,如果我在终端上键入gnuplot,则弹出gnuplot终端.我试图用python调用它,它说它没有安装.这可能是一个路径问题,但我只是想确保安装所需的一切.(道路建议也将受到赞赏)
Mac 10.7 Lion
基于这篇文章(我正在使用gnuplot gnuplot 4.6 patchlevel 1):
我试图set yr [GPVAL_DATA_Y_MIN:GPVAL_DATA_Y_MAX]在我的.pg脚本中使用,该脚本绘制来自此.dat文件的数据:
100 2
200 4
300 9
Run Code Online (Sandbox Code Playgroud)
但我得到:
undefined variable: GPVAL_DATA_Y_MIN
Run Code Online (Sandbox Code Playgroud)
这是我的脚本:
set terminal png
set output 'img.png'
set xlabel 'x-label'
set ylabel 'y-label'
set boxwidth 0.5
set style fill solid
set yrange [GPVAL_DATA_Y_MIN:GPVAL_DATA_Y_MAX]
plot 'sample.dat' with boxes title ""
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我使用以下脚本生成一个简单的eps图像:
set terminal epslatex 8
set output 'sample1.tex'
set size 0.75,0.75
set xrange [-pi:pi]
set yrange [0:1.2]
set xlabel "$x$"
set ylabel "$y$"
plot sin(x)*sin(x) title "$\\sin^2(x)$"
Run Code Online (Sandbox Code Playgroud)
但是,当我在gnuplot中运行它时
gnuplot> load "sample.gpi"
Run Code Online (Sandbox Code Playgroud)
我得到一张空白图片,只显示没有数字的网格.有什么建议我做错了什么?
我想用相同参数的不同值(比如我有五个值)创建一个图,并且所有图都在同一个图上.如何在gnuplot 4.4中完成?例如,考虑绘制f(x)= 1 /(1 + exp(x/a)).
我想使用Matlab中常用的样式用Gnuplot绘制3D直方图.我遵循的步骤顺序是:
set palette defined ( 0 '#000090',\
1 '#000fff',\
2 '#0090ff',\
3 '#0fffee',\
4 '#90ff70',\
5 '#ffee00',\
6 '#ff7000',\
7 '#ee0000',\
8 '#7f0000')
set pm3d at s
set view map
splot 'test.dat' u 1:2:3
Run Code Online (Sandbox Code Playgroud)
正如您在下面的数据中看到的,大多数条目都为零,这使得绘图非常蓝.在Matlab中,可以制作这种类型的直方图,零值具有白色.只有不为零的点具有上面调色板中的颜色.我希望这些点是白色的,因为这会强调实际的采样区域.
我想知道我们是否可以在Gnuplot那样做.我试图在数据文件中省略零,但它导致了一个尖角图.
另外,我修改了明确定义零值的调色板,如下所示:
set palette defined ( 0 '#ffffff',\
1 '#000090',\
2 '#000fff',\
3 '#0090ff',\
4 '#0fffee',\
5 '#90ff70',\
6 '#ffee00',\
7 '#ff7000',\
8 '#ee0000',\
9 '#7f0000')
Run Code Online (Sandbox Code Playgroud)
但是,采样区域的边框看起来是紫色的:
谢谢.
1 1 1
1 2 0
1 3 0
1 4 0
1 5 0
1 …Run Code Online (Sandbox Code Playgroud)