gnuplot

gnuplot single plot in different colors

ぐ巨炮叔叔 提交于 2021-01-28 07:41:15
问题 I have a single column of data (say 100 samples): plot 'file' using 1 with lines But this data is segmented: 10 points, then 10 more, etc... and I'd like each block of 10 to appear in a different color. I did filter them to 10 separate files and used plot 'file.1' with lines, 'file.2' with lines... But then the X axis goes 0..10 instead of 0..100 and all 10 graphs are stacked. Is there a simple way to do that without having to generate fake X data ? 回答1: Depending on your detailed data format

How to use `set term push` and `set term pop` in gnuplot

心已入冬 提交于 2021-01-28 07:12:17
问题 I am using gnuplot 5.2.7 on Arch Linux. I want to temporarily change the terminal's configuration, plot something, and then restore it (I have no terminal configuration in my initialization file). I think pop and push can be used to this effect, but I'm having no success. This is what I do in a gnuplot session. First I set the terminal to wxt and push it, then plot a sine wave: gnuplot> set term wxt 1 ; set term push Terminal type is now 'wxt' Options are '1 enhanced' pushed terminal wxt 1

Can gnuplot fetch plot data from remote locations (e.g. ftp servers)?

空扰寡人 提交于 2021-01-28 06:52:33
问题 Plotting a datafile with gnuplot works like plot 'filename' using 1:2 Is it possible that 'filename' points to a remote location, e.g. http://example.com/data.txt or ftp://ftp.example.com/data.txt ? If so, does it work on Linux and Windows alike or are platform specific commands needed? 回答1: No, you cannot directly open a file from a remote location via HTTP or FTP. You'll need to use a system-dependent command line program to fetch a data file on-the-fly, like the GET program. This is also

Gnuplot: data normalization

安稳与你 提交于 2021-01-28 05:30:14
问题 I have several time-based datasets which are of very different scale, e. g. [set 1] 2010-01-01 10 2010-02-01 12 2010-03-01 13 2010-04-01 19 … [set 2] 2010-01-01 920 2010-02-01 997 2010-03-01 1010 2010-04-01 1043 … I'd like to plot the relative growth of both since 2010-01-01. To put both curves on the same graph I have to normalize them. So I basically need to pick the first Y value and use it as a weight: plot "./set1" using 1:($2/10), "./set2" using 1:($2/920) But I want to do it

gnuplot: force y2 axis tics on y tics position

依然范特西╮ 提交于 2021-01-28 05:09:16
问题 inspired from the set link in another answer i want to plot a graph and show different scale axis. set grid mytics set xrange[1:5] set yrange[0:3] set y2range[0:30] set xlabel "a" set ylabel "b" set ytics set y2label "c" set mytics 2 ca = 0.05 cb = 0.5 f(x) = sin(x*pi/180)*cb *1000 i(x) = asin(x/1000 / cb )/pi*180 set link y2 via f(y) inverse i(y) pl asin(ca /x)/pi*180 title "a" it draws the plot and the axis as expected but what i want is that the tics on the y2 axis are exact on the ytics

gnuplot: force y2 axis tics on y tics position

送分小仙女□ 提交于 2021-01-28 05:04:17
问题 inspired from the set link in another answer i want to plot a graph and show different scale axis. set grid mytics set xrange[1:5] set yrange[0:3] set y2range[0:30] set xlabel "a" set ylabel "b" set ytics set y2label "c" set mytics 2 ca = 0.05 cb = 0.5 f(x) = sin(x*pi/180)*cb *1000 i(x) = asin(x/1000 / cb )/pi*180 set link y2 via f(y) inverse i(y) pl asin(ca /x)/pi*180 title "a" it draws the plot and the axis as expected but what i want is that the tics on the y2 axis are exact on the ytics

gnuplot: Is there a way to plot vertical lines spatially?

为君一笑 提交于 2021-01-28 04:40:17
问题 I am trying to plot several vertical lines of a variable, say velocity (m/s), against a x-axis of distance (m) and a y-axis of height(m). Each of the velocity profiles come as a function of height measured at different locations. So the aim is to observe how these profiles change spatially. I have thought to approach this by shifting the vertical profiles by the x-component corresponding to the location where each profile was measured. So if we suppose that the second x-axis depicts velocity

How do I read data from stdin to gnuplot and plot same data twice

痴心易碎 提交于 2021-01-28 02:58:17
问题 I have a program that generates data with a couple of input arguments and spits it out to stdout, I pipe this data to gnuplot and plot it (in my case I don't have an intermediate file): $ cat sample_data.dat | gnuplot plot_script.gp sample_data.dat: 0 0.5000 1 0.9225 2 0.2638 3 0.7166 4 0.7492 plot_script.gp #!/usr/bin/gnuplot set terminal wxt size 700,524 enhanced font 'Verdana,10' persist set style line 1 lc rgb '#0060ad' pt 7 lt 1 lw 0.5 # circle blue thin line set style line 2 lc rgb '

CERN ROOT: Is is possible to plot pairs of x-y data points?

对着背影说爱祢 提交于 2021-01-27 23:32:42
问题 I would like to use CERN ROOT to draw a 2d graph of pairs of x-y datapoints possibly also with y-errorbars . However I only know how to draw histograms. Is this possible with CERN ROOT? If so how? Also I realize that there may be better libraries for doing this. I have been using GNUPlot, but unfortunately I can't seem to integrate it well with my C++ code, since I can't find a C/C++ GNUPlot interface which covers all the features and allows me to send data in a bidirectional manner - ie:

Gnuplot Polar Coodinates Histogram

耗尽温柔 提交于 2021-01-27 18:15:02
问题 I have a data file file.dat with three columns (radio, angle, Temperature) for points in the plane, and I want to plot this data as a histogram using polar coordenates and color maps, like in the figure below but using gnuplot. I can create a histogram.dat file with the values of the bins that I want but I don't know how to plot it in gnuplot 回答1: To my knowledge there is no right-away "polar heatmap" plotting style in gnuplot (but I could be wrong, at least, I haven't seen an example on the