gnuplot

Gnuplot - coloring a plot according to x-value

℡╲_俬逩灬. 提交于 2019-12-20 07:28:28
问题 I would like to change the color of a plot according to the x-value, for a function plot (i.e. not from a data file). For example, I define a palette as follows: set palette defined ( 0 'purple', 1 'blue', 2 'green', 3 'yellow', 4 'orange', 5 'red' ) and I wish to use the color the function sin(x) using my palette according to the x value for the range [0:5]. How can this be done? 回答1: You can use linecolor palette for this purpose, which requires the specification of an additional column

gnuplot: set columnheader as label

蓝咒 提交于 2019-12-20 05:35:10
问题 Is there a chance to set the header of the data file columns as label (not as key)? I have data files with 5 or 6 columns and a header above each column. Now I would like to use the columnheader with the set label command. Is this possible? 回答1: On a unixoid system, the head command helps: header = system("head -n 1 ".filename) label1 = word(header,1) label2 = word(header,2) ... set label 1 at 0.5,0.5 label1 set label 2 .... MS win does not have the head command, you might use 'findstr /B \"#

How to label vector in gnuplot

安稳与你 提交于 2019-12-20 04:48:08
问题 I would like to know how to give a label at the end of a vector in gnuplot. I know it is possible to use "set" in gnuplot to show a certain label at some place, but I have hundreds of vectors to draw, and I want to show the index of each vector at its end, e.g., "Node n". Thus I wonder if it is possible to show the labels with incremental index in "one step" with corresponding vectors. My OS is Ubuntu 13.04 32bit version. Thanks for any advice! 回答1: Imagine you have a file with the following

Gnuplot: change font size for plot with labels

独自空忆成欢 提交于 2019-12-20 04:38:28
问题 I would like to be able to control the font size for the labels produced by plot file u 1:2:(sprintf("%4.3f", $1)) with labels offset char 0,2 t "" but have not found a way yet. Let me add that I use the epslatex terminal. 回答1: In the case of the latex terminals the font choice and size are under the control of LaTeX rather than gnuplot's internal enhanced text processing. You would have to format the label as a TeX command. plot file u 1:2:(sprintf('{\\tiny %4.3f}', $1)) with labels notitle

producing variable colors with decimal numbers

一曲冷凌霜 提交于 2019-12-20 04:21:21
问题 I created a file which looks like where the first column is the color line in decimal and the second column is y-axis. The x-axis is the row number. 0 0 1 1 2 2 ... Then I run this command plot "test.dat" u 0:2:1 pt 7 ps 1 lc rgb variable As you can see in the picture, the output contains a range of black to blue colors only. Why? How can I produce other colors? 回答1: Basically you have the choice between three options, linecolor rgb variable , linecolor variable and linecolor palette . Which

gnuplot, draw only the legend and not the graph plot

≯℡__Kan透↙ 提交于 2019-12-20 03:43:08
问题 I have an interactive perl script which uses data from mysql to generate many plots through the Chart::Gnuplot package. There are times when the graph size is overloaded with too many plots. I would option to generate the gnuplot image containing only the legend (no graph). 回答1: I don't know if this would help, but... plot [0:1] [0:1] NaN title "Hello" #Just the label in the legend. or... plot sin(x),NaN title "Boo" #Plots sin(x) (properly labelled) and a second label "Boo" Of course, this

How to use one of the column of data as legend in gnuplot?

▼魔方 西西 提交于 2019-12-20 03:20:00
问题 I have data something like this: # c1 c2 c3 23 b 323 23 g 54 23 a 11 23 c 1 23 d 0 23 e 397 23 f 40 24 b 23 24 g 24 24 a 113 24 c 12 24 d 10 24 e 7 24 f 50 I need to plot with c1 on x-axis (23,24), c3 on y-axis for different values of c2 i.e, multiple graphs with different colors for each value of c2. 回答1: In general, you must do the filtering outside of gnuplot, in order to have lines connecting the filtered points. If you know all values which can appear in the second column, you can use

Gnuplot pm3d not plotting all data

对着背影说爱祢 提交于 2019-12-20 03:19:09
问题 I have a text file that looks like this: 0 0 1 0 1 -1 1 0 -1 1 1 1 I'm plotting this with pm3d with the number of colours in the palette set to two. What I'm expecting is four squares, two white and two black, in opposite corners. However, when I plot this, I just get one black square measuring 1 by 1. I was initially working with much larger grids, and gnuplot seemed always to be plotting one less row and column than I wanted. What's going wrong? 回答1: The pm3d option is averaging your z

Change x-values in gnuplot

纵饮孤独 提交于 2019-12-20 03:16:08
问题 I'm plotting a column of data which represents a time series in gnuplot. Every value represents a time value after 500 iterations / time units. Can I tell gnuplot to multiply the x-values it displays by 500? I thought this would be a standard problem since every time one has to plot a time series one needs to tell the plotting program what time unit each iteration has. I don't want to create an extra column with x-values manually, since I have a lot of different data of different length. I

Labelling individual data points gnuplot

假如想象 提交于 2019-12-20 02:52:35
问题 Just trying to get used to gnuplot. I searched a few pages on this site looking for the answer, read the documentation (4.6), and still haven't found the answer. say I have a data file like this: 0.0 0 1.0 25 2.0 55 3.0 110 4.0 456 5.0 554 6.0 345 and I want to label all the data points on the plot. How do I do this? I tried this suggestion plot 'exp.dat' u 1:2 w labels point offset character 0,character 1 tc rgb "blue" but it didn't work. It gave me a Not enough columns for this style