天道酬勤,学无止境

gnuplot

在 gnuplot 中绘制两个轴(Plotting two axes in gnuplot)

问题 是否可以绘制两条曲线,在 gnuplot 中有两个对应的轴,每个轴都有不同的比例? 例如,同一图中的y=x**2和y=x**4 (当使用相同比例绘制时,它们的变化足以“令人不舒服”)。 回答1 您可以自动处理轴,而无需自己缩放它们并保持自动缩放: set terminal jpeg set output 'graph.jpg' set xrange [-10:10] set ytics 10 nomirror tc lt 1 set ylabel '2*x' tc lt 1 set y2tics 20 nomirror tc lt 2 set y2label '4*x' tc lt 2 plot 2*x linetype 1, 4*x linetype 2 axes x1y2 回答2 可以为 y 和 y2(右轴)设置不同的范围,甚至可以独立设置标签/抽动的颜色。 然后我们简单地将第二个函数除以 2(或其他适当的值)并设置颜色......如本例所示: set xrange [-10:10] set yrange [-20:20] set y2range [-40:40] set ytics 10 nomirror tc lt 1 set ylabel '2*x' tc lt 1 set y2tics 20 nomirror tc lt 2 set y2label '4*x'

2021-06-21 12:59:23    分类:技术分享    plot   gnuplot   axes

How to plot a function of an imported data in gnuplot?

If I have a file of several data points. How can I plot a function of them? For example, suppose I have a file of to columns x and y and I want to plot sin(y) as a function of 1/x.

2021-06-15 08:11:52    分类:问答    gnuplot

why the interactive mode of my gnuplot installation won't rotate when it will for batch.dem files and also for Octave

I have gnuplot 4.6 working on Mac OS X. It works from Octave as well. This isn't an octave related question, just trying to convince you that gnuplot seems to be installed fine. My problem is that while I CAN rotate plots with the mouse (am using x11 as the plotting window) in a batch sort of mode (e.g. $unixPrompt> gnuplot pm3d.dem works fine: I can rotate/zoom them), and ALSO can rotate 3d plots created from within Octave, but I CANNOT just go into gnuplot and rotate any such plot from the interactive gnuplot program. ie. gnuplot> issuePlotCommands… will put up the plot just fine, but I

2021-06-15 07:37:28    分类:问答    input   mouse   rotation   gnuplot   interactive

Gnuplot: how to fill a bar with both a color background and a pattern

I want to fill a bar with both a color background and a pattern. Is it possible in Gnuplot? I am using Gnuplot 4.6.5 The code I have now: # set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 # set output 'histograms.2.png' set boxwidth 0.9 absolute set style fill solid 1.00 border lt -1 set key inside right top vertical Right noreverse noenhanced autotitles nobox set style histogram clustered gap 1 title offset character 0, 0, 0 set datafile missing '-' set style data histograms set xtics border in scale 0,0 nomirror rotate by -45 offset character 0, 0, 0

2021-06-15 02:26:38    分类:问答    gnuplot   bar-chart

How to set timezone in gnuplot?

I have a simple gnuplot command file: .... set xdata time set timefmt "%s" set format x "%H:%M" .... where x - timestamp column. Result - time in UTC format. Can I change local timezome for x axis ?

2021-06-15 00:44:08    分类:问答    gnuplot

How to Create a Spider Plot in Gnuplot?

I would like to produce a spider (aka radar/star) plot using Gnuplot where different axes have independent scales. I am able to produce such a plot using OriginPro (commercial), but with Gnuplot I am only able to set a radar plot with uniform scale. The (csv file) dataset looks like the following (first row is column labels): # FEATURE, Product_A, Product_B, Product_C, Product_D attribute_1, 2, 10, 7, 3.5 attribute_2, 1, 0.5, 3,4 attribute_3, 37, 58, 49, 72 attribute_4, 1985, 1992, 2006, 2010 attribute_5, 0.1, 0.5, 0.3, 0.8 and the plot I am looking for is this one: https://www.dropbox.com/s

2021-06-14 23:53:26    分类:问答    graph   plot   gnuplot

gnuplot candlestick red and green fill

Candlestick plots on the financial sites, at least the ones I have seen, fill the candlestick green if the close is higher then the open, and red if the close is lower then the open. If I set the fill style all candlesticks are filled with the fill color, is there a way in gnuplot 4.6 to use the color scheme as I described above? A sample script is: set xdata time set timefmt"%Y-%m-%d %H:%M:%S" set xrange ["2014-01-01":"2014-01-02"] set yrange [*:*] set datafile separator "," plot '201401_EURUSD_Hourly.csv' using 1:2:4:3:5 notitle with candlesticks with some data points 2014-01-01 17:00:00,1

2021-06-14 19:44:37    分类:问答    gnuplot   candlestick-chart

How to call gnuplot from CLI and save the output graph to the image file?

I'm writing a batch file which will also generate a gnuplot graph from a dat file. I wish to call gnuplot from the command line, using the gnuplot "gnu" script I have written, and save the output graph to an image. Something like: gnuplot.exe script.gnu > image.png Any ideas?

2021-06-14 17:51:25    分类:问答    gnuplot

gnuplot heat map color range

I have some X Y Z data in a file and I'm using gnuplot to display it. I am creating a heat map, ie. a 2D plot where the Z value is presented using color. Right now I'm using the following script: set palette defined (0 "blue", 1 "red") plot "xyz.dat" u $1:$2:$3 w image My problem is, gnuplot ignores the 0 and 1 in the palette definition. It uses the colors specified, but rescales according to the minimal and maximal Z value in the file. This makes it hard to visually compare different plots whose z range is different. How do I tell gnuplot to stop rescaling the z color range?

2021-06-14 10:31:38    分类:问答    map   gnuplot   heat

Terminal “png” missing when using Gnuplot

I'm using Xubuntu 13.10 and I installed gnuplot by compiling it manully. However, when I test the feature of "plot" it got an error: $ python PlotSccDistr.py set terminal png size 1000,800 ^ "scc.example.plt", line 16: unknown or ambiguous terminal type; type just 'set terminal' for a list and if I want to set terminal png, but I found no "png" in my list: $ gnuplot G N U P L O T Version 4.6 patchlevel 5 last modified February 2014 Build System: Linux x86_64 Copyright (C) 1986-1993, 1998, 2004, 2007-2014 Thomas Williams, Colin Kelley and many others gnuplot home: http://www.gnuplot.info faq

2021-06-14 05:48:58    分类:问答    linux   png   gnuplot