gnuplot

gnuplot : how to save datafile values into a variable (with condition)?

蹲街弑〆低调 提交于 2020-01-13 05:53:09
问题 I use Gnuplot and I would like to save values of a datafile into a variable with condition. For example, I have the following datafile 'example.dat': columnl column2 5 7.0 3 4.0 7 6.0 In my gnuplot script, I would like to be able to write: variable = " in the file 'example.dat' ($1)==5 ? $2 : 1/0 " which would be here the same as: variable = 7.0 of course the value depends on the datafile. So is it possible? If not, is it possible without condition? 回答1: This is how I worked around the

Fill several sections below a curve of data in Gnuplot

我是研究僧i 提交于 2020-01-13 04:29:09
问题 I have a set of points "data" defining a curve that I want to plot with bezier smooth. So I want to fill the area below that curve between some pairs of x values. If I only had one pair of x values it's not that difficult because I define a new set of data and plot it with filledcu. Example: The problem is that I want to do that several times in the same plot. Edit: Minimal working example: #!/usr/bin/gnuplot set terminal wxt enhanced font 'Verdana,12' set style fill transparent solid 0.35

Fill several sections below a curve of data in Gnuplot

跟風遠走 提交于 2020-01-13 04:29:07
问题 I have a set of points "data" defining a curve that I want to plot with bezier smooth. So I want to fill the area below that curve between some pairs of x values. If I only had one pair of x values it's not that difficult because I define a new set of data and plot it with filledcu. Example: The problem is that I want to do that several times in the same plot. Edit: Minimal working example: #!/usr/bin/gnuplot set terminal wxt enhanced font 'Verdana,12' set style fill transparent solid 0.35

gnuplot - adjust size of key/legend

时间秒杀一切 提交于 2020-01-11 15:48:06
问题 How do I adjust the size of the legend in gnuplot (4.6.0)? By this I mean the size of the lines and not just the font size. When I switched from the pdf to pdfcairo terminal the size suddenly jumped and caused the key to overlap the points of interest. (I needed cairo to enable unicode.) An answer I have just invented is (e.g.): set key font ",8" set key spacing 0.5 Is there a better way? 回答1: To adjust the length of the samples: set key samplen X (default is 4) To adjust the vertical spacing

The horizontal key displays in vertical in GNUPLOT

青春壹個敷衍的年華 提交于 2020-01-11 12:09:31
问题 In gnuplot , I used the horizontal key, but it shows me vertical on the output screen. I tried every alternative but found difficult to do that. set terminal wxt size 600,600 enhanced font 'times new roman,10' persist set xlabel "X-Axis" set ylabel "Y-Axis" set multiplot layout 2,3 set key box set key horiz set key at screen 0.5, 0.40 set title "1st" set xrange [0:20] plot tan((pi/180)*x) title "Analytical" w l ls 1,\ tan(2*(pi/180)*x) title "Observed" w lp ls 2,\ tan(3*(pi/180)*x) title

The horizontal key displays in vertical in GNUPLOT

一曲冷凌霜 提交于 2020-01-11 12:09:08
问题 In gnuplot , I used the horizontal key, but it shows me vertical on the output screen. I tried every alternative but found difficult to do that. set terminal wxt size 600,600 enhanced font 'times new roman,10' persist set xlabel "X-Axis" set ylabel "Y-Axis" set multiplot layout 2,3 set key box set key horiz set key at screen 0.5, 0.40 set title "1st" set xrange [0:20] plot tan((pi/180)*x) title "Analytical" w l ls 1,\ tan(2*(pi/180)*x) title "Observed" w lp ls 2,\ tan(3*(pi/180)*x) title

Gnuplot 3d plot too high

筅森魡賤 提交于 2020-01-11 10:34:12
问题 I have this plot And as you can see, there's this gap between the zero and the bottom of the plot, is it possible to move the plot down so the 0 is at the bottom? 回答1: Yes, it is possible. Use: set xyplane at 0 to remove the offset. On older gnuplot, you may need to use: set ticslevel 0 instead. 回答2: I can't really test it without your data, but did you try to set the limits on the axis? if not set manually, octave sometimes takes liberties to shift the data. https://www.gnu.org/software

undefined variable: GPVAL_DATA_Y_MIN (Gnuplot)

风流意气都作罢 提交于 2020-01-11 04:01:06
问题 Based on this post (I am using gnuplot gnuplot 4.6 patchlevel 1): gnuplot: max and min values in a range I am trying to use set yr [GPVAL_DATA_Y_MIN:GPVAL_DATA_Y_MAX] in my .pg script that plots data from this .dat file: 100 2 200 4 300 9 But I get: undefined variable: GPVAL_DATA_Y_MIN This is my script: 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

How to plot specific rows in GNUplot

人走茶凉 提交于 2020-01-10 10:10:31
问题 I have a two-column file which has 1000000 entries, that is 1000000 rows, however I don't want to plot all the data, I just want to plot the points every 100 lines? How to do this in gnuplot? Also, is it possible to specify some particular rows to plot in gnuplot? 回答1: You have at least two options here. First, check out the documentation for help datafile every plot 'datafile' every 100 using 1:2 Another option is to use the pseudo-column 0 ( help datafile using pseudo ) in conjunction with

How to plot specific rows in GNUplot

℡╲_俬逩灬. 提交于 2020-01-10 10:09:41
问题 I have a two-column file which has 1000000 entries, that is 1000000 rows, however I don't want to plot all the data, I just want to plot the points every 100 lines? How to do this in gnuplot? Also, is it possible to specify some particular rows to plot in gnuplot? 回答1: You have at least two options here. First, check out the documentation for help datafile every plot 'datafile' every 100 using 1:2 Another option is to use the pseudo-column 0 ( help datafile using pseudo ) in conjunction with