Download gnuplot version 4.6






















The interactive file manager requires Javascript. Please enable it or use sftp or scp. You may still browse the files here. You seem to have CSS turned off. Please don't fill out this field. Please provide the ad click URL, if possible:. Oh no! Some styles failed to load. Help Create Join Login. Application Development. For example, Denmark is totally missing in the original data file.

The good thing is, there is other data available in the web. At the download page, three different resolutions of the data are available with a scale of m, m, or m.

The data itself is stored as shape files on naturalearthdata. Hence I wrote a script that converts the data first to a csv file using the ogr2ogr program. Afterwards the data is shaped with sed into the form of the original world. Here are the resulting files:.

Note that we have to use linetype instead of linestyle in gnuplot 4. In order to compare the different resolutions of the coast line files, we plot only the part of the map where Denmark is located which is completely missing in the original data.

The following example checks that C can safely be expanded as the name of a user-defined variable:. Macro expansion does not occur inside either single or double quotes. However macro expansion does occur inside backquotes. Macro expansion is handled as the very first thing the interpreter does when looking at a new line of commands and is only done once. Therefore, code like the following will execute correctly:. For execution of complete commands the evaluate command may also be handy. The interaction of string variables, backquotes and macro substitution is somewhat complicated.

Backquotes do not block macro substitution, so. And double quotes do not block backquote substitution, so.

However, macro substitution is not performed inside double quotes, so you cannot define a system command as a macro and then use both macro and backquote substitution at the same time.

To store a system command as a macro and execute it later you must instead include the backquotes as part of the macro itself. This is accomplished by defining the macro as shown below. Notice that the sprintf format nests all three types of quotes.

Options and any accompanying parameters are separated by spaces whereas lists and coordinates are separated by commas. Ranges are separated by colons and enclosed in brackets [], text and file names are enclosed in quotes, and a few miscellaneous things are enclosed in parentheses.

Commas are used to separate coordinates on the set commands arrow , key , and label ; the list of variables being fitted the list after the via keyword on the fit command ; lists of discrete contours or the loop parameters which specify them on the set cntrparam command; the arguments of the set commands dgrid3d , dummy , isosamples , offsets , origin , samples , size , time , and view ; lists of tics or the loop parameters which specify them; the offsets for titles and axis labels; parametric functions to be used to calculate the x, y, and z coordinates on the plot , replot and splot commands; and the complete sets of keywords specifying individual plots data sets or functions on the plot , replot and splot commands.

Parentheses are used to delimit sets of explicit tics as opposed to loop parameters and to indicate computations in the using filter of the fit , plot , replot and splot commands. Square brackets are used to delimit ranges given in set , plot or splot commands.

Colons are used to separate extrema in range specifications whether they are given on set , plot or splot commands and to separate entries in the using filter of the plot , replot , splot and fit commands. Gnuplot uses three forms of quote marks for delimiting text strings, double-quote ascii 34 , single-quote ascii 39 , and backquote ascii Filenames may be entered with either single- or double-quotes. In this manual the command examples generally single-quote filenames and double-quote other string tokens for clarity.

String constants and text strings used for labels, titles, or other plot elements may be enclosed in either single quotes or double quotes. Further processing of the quoted text depends on the choice of quote marks.

In single-quoted strings, backslashes are just ordinary characters. To get a single-quote ascii 39 in a single-quoted string, it has to be doubled. Text justification is the same for each line of a multi-line string. Thus the center-justified string. Enhanced text processing is performed for both double-quoted text and single-quoted text, but only by terminals supporting this mode. See enhanced text p. Back-quotes are used to enclose system commands for substitution into the command line.

See substitution p. This feature is activated by the commands set xdata time , set ydata time , etc. Internally all times and dates are converted to the number of seconds from the year The command set timefmt defines the format for all inputs: data files, ranges, tics, label positions — in short, anything that accepts a data value must receive it in this format. The conversion to and from seconds assumes Universal Time which is the same as Greenwich Standard Time.

There is no provision for changing the time zone or for daylight savings. If all your data refer to the same time zone and are all either daylight or standard you don't need to worry about these things.

But if the absolute time is crucial for your application, you'll need to convert to UT yourself. Commands like show xrange will re-interpret the integer according to timefmt.

If you change timefmt , and then show the quantity again, it will be displayed in the new timefmt. For that matter, if you give the deactivation command like set xdata , the quantity will be shown in its numerical form.

If you use tabs as a separator, some trial-and-error may be necessary to discover how your system treats them. The time function can be used to get the current system time. The type of the argument determines what is returned. If the argument is an integer, time returns the current time as an integer, in seconds from 1 Jan If the argument is real or complex , the result is real as well.

The precision of the fractional sub-second part depends on your operating system. Suppose the file " data " contains records like. There are many plotting styles available in gnuplot. They are listed alphabetically below. The commands set style data and set style function change the default plotting style for subsequent plot and splot commands. You also have the option to specify the plot style explicitly as part of the plot or splot command.

If you want to mix plot styles within a single plot, you must specify the plot style for each component. Each plot style has its own expected set of data entries in a data file. For example by default the lines style expects either a single column of y values with implicit x ordering or a pair of columns with x in the first and y in the second.

For more information on how to fine-tune how columns in a file are interpreted as plot data, see using p. The boxerrorbars style is only relevant to 2D data plotting. It is a combination of the boxes and yerrorbars styles. It uses 3, 4, or 5 columns of data:.

The boxwidth will come from the fourth column if the y errors are given as " ydelta " and the boxwidth was not previously set to In this case the boxwidth will be calculated so that each box touches the adjacent boxes.

The width will also be calculated in cases where three-column data are used. An additional 4th, 5th or 6th input column may be used to provide variable per-datapoint color information see linecolor p. The error bar will be drawn in the same color as the border of the box.

See also errorbar demo. The boxes style is only relevant to 2D plotting. It draws a box centered about the given x coordinate that extends from the x axis not from the graph border to the given y coordinate. It uses 2 or 3 columns of basic data. Additional input columns may be used to provide information such as variable line or fill color see rgbcolor variable p. The width of the box is obtained in one of three ways.

If the input data has a third column, this will be used to set the width of the box. If not, if a width has been set using the set boxwidth command, this will be used. If neither of these is available, the width of each box will be calculated automatically so that it touches the adjacent boxes.

The interior of the boxes is drawn according to the current fillstyle. See set style fill p. Alternatively a new fillstyle may be specified in the plot command. For fillstyle solid the box is filled with a solid rectangle of the current drawing color. For fillstyle pattern the box is filled in the current drawing color with a pattern, if supported by the terminal driver.

To plot a data file with solid filled boxes with a small vertical space separating them bargraph :. The sin plot will use pattern 0; the cos plot will use pattern 1. Any additional plots would cycle through the patterns supported by the terminal driver. Boxplots are a common way to represent a statistical distribution of values.

A box is drawn around the region between the first and third quartiles, with a horizontal line at the median value. Whiskers extend from the box to user-specified limits. Points that lie outside these limits are drawn individually. By default only one boxplot is produced that represents all y values from the second column of the using specification.

However, an additional fourth colunm can be added to the specification. If present, the values of that column will be interpreted as the discrete levels of a factor variable. As many boxplots will be drawn as there are levels in the factor variable. The separation between these boxplots is 1.

By default, the value of the factor variable is shown as a tic label below or above each boxplot. The first and third columns x coordinate and width are normally provided as constants rather than as data columns. By default the whiskers extend from the ends of the box to the most distant point whose y value lies within 1.

By default outliers are drawn as circles point type 7. The width of the bars at the end of the whiskers may be controlled using set bars. These default properties may be changed using the set style boxplot command. See set style boxplot p. The boxxyerrorbars style is only relevant to 2D data plotting. It is similar to the xyerrorbars style except that it draws rectangular areas rather than simple crosses.

It uses either 4 or 6 basic columns of input data. An additional 5th or 7th input column may be used to provide variable per-datapoint color information see linecolor p. The candlesticks style can be used for 2D data plotting of financial data or for generating box-and-whisker plots of statistical data. The symbol is a rectangular box, centered horizontally at the x coordinate and limited vertically by the opening and closing prices. A vertical line segment at the x coordinate extends up from the top of the rectangle to the high price and another down to the low.

The vertical line will be unchanged if the low and high prices are interchanged. The width of the rectangle can be controlled by the set boxwidth command.

Alternatively, an explicit width for each box-and-whiskers grouping may be specified in an optional 6th column of data. The width must be given in the same units as the x coordinate. An additional 6th, or 7th if the 6th column is used for width data input column may be used to provide variable per-datapoint color information see linecolor p.

By default the vertical line segments have no crossbars at the top and bottom. If you want crossbars, which are typically used for box-and-whisker plots, then add the keyword whiskerbars to the plot command. By default these whiskerbars extend the full horizontal width of the candlestick, but you can modify this by specifying a fraction of the full width. This is the behavior you will get if the current fillstyle is set to " empty ".

See fillstyle p. If you set the fillstyle to solid or pattern, then this will be used for all boxes independent of open and close values. See also set bars p. See also the candlestick and finance demos. Note: To place additional symbols, such as the median value, on a box-and-whisker plot requires additional plot commands as in this example:. See set boxwidth p. The circles style plots a circle with an explicit radius at each data point.

If three columns of data are present, they are interpreted as x, y, radius. The radius is always interpreted in the units of the plot's horizontal axis x or x2. The scale on y and the aspect ratio of the plot are both ignored. If only two columns are present, the radius is taken from set style circle. In this case the radius may be given in graph or screen coordinates. By default a full circle will be drawn. It is possible to plot arc segments instead of full circles by specifying a start and end angle in the 4th and 5th columns.

An optional 4th or 6th column can specify per-circle color. The start and end angles of the circle segments must be specified in degrees.

The result is similar to using a points plot with variable size points and pointstyle 7, except that the circles will scale with the x axis range. See also set object circle p. The ellipses style plots an ellipse at each data point. This style is only relevant for 2D plotting. Each ellipse is described in terms of its center, major and minor diameters, and the angle between its major diameter and the x axis.

If only two input columns are present, they are taken as the coordinates of the centers, and the ellipses will be drawn with the default extent see set style ellipse p.

The orientation of the ellipse, which is defined as the angle between the major diameter and the plot's x axis, is taken from the default ellipse style see set style ellipse p. If three input columns are provided, the third column is used for both diameters. The orientation angle defaults to zero. If four columns are present, they are interpreted as x, y, major diameter, minor diameter. Note that these are diameters, not radii. An optional 5th column may be used to specify the orientation angle in degrees.

The ellipses will also be drawn with their default extent if either of the supplied diameters in the column form is negative. In all of the above cases, optional variable color data may be given in an additional last 3th, 4th, 5th or 6th column.

See colorspec p. By default, the major diameter is interpreted in the units of the plot's horizontal axis x or x2 while the minor diameter in that of the vertical y or y2.

This behavior can be changed with the units keyword, however. There are three alternatives: if units xy is included in the plot specification, the axes will be scaled as described above.

In the latter two cases the ellipses will have the correct aspect ratio, even if the plot is resized. If units is omitted, the default setting will be used, which is equivalent to units xy. This can be redefined by set style ellipse. See also set object ellipse p. The dots style plots a tiny dot at each point; this is useful for scatter plots with many points. Either 1 or 2 columns of input data are required in 2D.

Three columns are required in 3D. For some terminals post, pdf the size of the dot can be controlled by changing the linewidth. The filledcurves style is only relevant to 2D plotting. Three variants are possible. The first two variants require either a function or two columns of input data, and may be further modified by the options listed below. The first variant, closed , treats the curve itself as a closed polygon.

This is the default if there are two columns of input data. The second variant is to fill the area between the curve and a given axis, a horizontal or vertical line, or a point. The third variant requires three columns of input data: the x coordinate and two y coordinates corresponding to two curves sampled at the same set of x coordinates; the area between the two curves is filled.

This is the default if there are three or more columns of input data. The above and below options apply both to commands of the form. Zooming a filled curve drawn from a datafile may produce empty or incorrect areas because gnuplot is clipping points and lines, and not areas. The financebars style is only relevant for 2D data plotting of financial data. It requires 1 x coordinate usually a date and 4 y values prices. An additional 6th input column may be used to provide variable per-record color information see linecolor p.

The symbol is a vertical line segment, located horizontally at the x coordinate and limited vertically by the high and low prices. A horizontal tic on the left marks the opening price and one on the right marks the closing price.

The length of these tics may be changed by set bars. The symbol will be unchanged if the high and low prices are interchanged. See set bars p. The fsteps style is only relevant to 2D plotting. It connects consecutive points with two line segments: the first from x1,y1 to x1,y2 and the second from x1,y2 to x2,y2.

The input column requires are the same as for plot styles lines and points. The difference between fsteps and steps is that fsteps traces first the change in y and then the change in x. See also steps demo. See steps p. The histeps style is only relevant to 2D plotting.

It is intended for plotting histograms. The lines representing the end points are extended so that the step is centered on at x. If autoscale is in effect, it selects the xrange from the data rather than the steps, so the end points will appear only half as wide as the others. The histograms style is only relevant to 2D plotting. It produces a bar chart from a sequence of parallel data columns.

Each element of the plot command must specify a single input data source e. Four styles of histogram layout are currently supported. The default style corresponds to set style histogram clustered gap 2. In this style, each set of parallel data values is collected into a group of boxes clustered at the x-axis coordinate corresponding to their sequential position row in the selected datafile columns.

The default gap width of 2 indicates that the empty space between clusters is equivalent to the width of 2 boxes. Each cluster of boxes is derived from a single row of the input data file. It is common in such input files that the first element of each row is a label. Labels from this column may be placed along the x-axis underneath the appropriate cluster of boxes with the xticlabels option to using.

The errorbars style is very similar to the clustered style, except that it requires additional columns of input for each entry. The first column holds the height y value of that box, exactly as for the clustered style. In these styles the data values from the selected columns are collected into stacks of boxes.

Mixed positive and negative values will produce both an upward stack and a downward stack. The default stacking mode is rowstacked. The columnstacked style is similar, except that each stack of boxes is built up from a single data column. In this style the color of each box is taken from the row number, rather than the column number, of the corresponding data field. Box widths may be modified using the set boxwidth command. Box fill styles may be set using the set style fill command. Histograms always use the x1 axis, but may use either y1 or y2.

If a plot contains both histograms and other plot styles, the non-histogram plot elements may use either the x1 or the x2 axis.

Examples: Suppose that the input file contains data values in columns 2, 4, 6, This example plots the values in columns 2 and 4 as a histogram of clustered boxes the default style. Because we use iteration in the plot command, any number of data columns can be handled in a single command.

This will produce a plot with clusters of two boxes vertical bars centered at each integral value on the x axis. If the first column of the input file contains labels, they may be placed along the x-axis using the variant command. If the file contains both magnitude and range information for each value, then error bars can be added to the plot. The error bars and bar ends are drawn with linewidth 2, using the border linetype from the current fill style.

To plot the same data as a rowstacked histogram. Just to be different, this example lists the separate columns explicitly rather than using iteration. This will produce a plot in which each vertical bar corresponds to one row of data. Each vertical bar contains a stack of two segments, corresponding in height to the values found in columns 2 and 4 of the datafile.

Because this interchanges gnuplot's usual interpretation of input rows and columns, the specification of key titles and x-axis tic labels must also be modified accordingly. See the comments given below. Note that the two examples just given present exactly the same data values, but in different formats. More than one set of histograms can appear in a single plot.

In this case you can force a gap between them, and a separate label for each set, by using the newhistogram command. The labels " Set A " and " Set B " will appear beneath the respective sets of histograms, under the overall x axis label. The newhistogram command can also be used to force histogram coloring to begin with a specific color linetype. By default colors will continue to increment successively even across histogram boundaries.

Here is an example using the same coloring for multiple histograms. Similarly you can force the next histogram to begin with a specified fillstyle. If the fillstyle is set to pattern , then the pattern used for filling will be incremented automatically. If you want to create a histogram from many columns of data in a single file, it is very convenient to use the plot iteration feature. For example, to create stacked histograms of the data in columns 3 through 8. The image , rgbimage , and rgbalpha plotting styles all project a uniformly sampled grid of data values onto a plane in either 2D or 3D.

The input data may be an actual bitmapped image, perhaps converted from a standard format such as PNG, or a simple array of numerical values. This figure illustrates generation of a heat map from an array of scalar values. The current palette is used to map each value onto the color assigned to the corresponding pixel. Each pixel data point of the input 2D image will become a rectangle or parallelipiped in the plot.

The coordinates of each data point will determine the center of the parallelipiped. That is, an M x N set of data will form an image with M x N pixels. This is different from the pm3d plotting style, where an M x N set of data will form a surface of M-1 x N-1 elements. The scan directions for a binary image data grid can be further controlled by additional keywords. See binary keywords flipx p. Image data can be scaled to fill a particular rectangle within a 2D plot coordinate system by specifying the x and y extent of each pixel.

See binary keywords dx p. To generate the figure above, the same input image was placed multiple times, each with a specified dx, dy, and origin. The input PNG image of a building is 50x pixels. The image style handles input pixels containing a grayscale or color palette value. Thus 2D plots plot command require 3 columns of data x,y,value , while 3D plots splot command require 4 columns of data x,y,z,value. The rgbimage style handles input pixels that are described by three separate values for the red, green, and blue components.

Thus 5D data x,y,r,g,b is needed for plot and 6D data x,y,z,r,g,b for splot. The individual red, green, and blue components are assumed to lie in the range [].

The rgbalpha style handles input pixels that contain alpha channel transparency information in addition to the red, green, and blue components. Thus 6D data x,y,r,g,b,a is needed for plot and 7D data x,y,z,r,g,b,a for splot. The r, g, b, and alpha components are assumed to lie in the range [].

The rgbalpha plotting style assumes that each pixel of input data contains an alpha value in the range []. All terminal types can handle these two extreme cases.

Only a few terminal types can handle this correctly; other terminals will approximate this by treating alpha as being either 0 or Some terminal drivers provide code to optimize rendering of image data within a rectangular 2D area. However this code is known to be imperfect.

This optimized code may be disabled by using the keyword failsafe. Note that the y or z values may be negative. Data from additional columns can be used to control the color of each impulse.

This approximates a 3D bar chart. The labels style reads coordinates and text from a data file and places the text string at the corresponding 2D or 3D position. Additional input columns may be used to provide information such as variable font size or text color see rgbcolor variable p.

The font, color, rotation angle and other properties of the printed text may be specified as additional command options see set label p. The example below generates a 2D plot with text labels constructed from the city whose name is taken from column 1 of the input file, and whose geographic coordinates are in columns 4 and 5. The font size is calculated from the value in column 3, in this case the population. If we did not want to adjust the font size to a different size for each city name, the command would be much simpler:.

The labels style can also be used in 3D plots. In this case four input column specifiers are required, corresponding to X Y Z and text. See also datastrings p. The lines style connects adjacent points with straight line segments. It may be used in either 2D or 3D plots. The basic form requires 1, 2, or 3 columns of input data. Additional input columns may be used to provide information such as variable line color see rgbcolor variable p.

See also linetype p. The linespoints style connects adjacent points with straight line segments and then goes back to draw a small symbol at each point. The command set pointsize may be used to change the default size of the points. See style lines p. Additional input columns may be used to provide information such as variable point size or line color. The pointinterval short form pi property of the linetype can be used to control whether or not every point in the plot is given a symbol.

For example, 'with lp pi 3' will draw line segments through every data point, but will only place a symbol on every 3rd point. A negative value for pointinterval will erase the portion of line segment that passes underneath the symbol. The size of the erased portion is controlled by set pointintervalbox. The points style displays a small symbol at each point. Additional input columns may be used to provide information such as variable point size or variable point color. Polar plots are not really a separate plot style but are listed here for completeness.

Many, but not all, 2D plotting styles work in polar mode. The figure shows a combination of plot styles lines and filledcurves.

The steps style is only relevant to 2D plotting. It connects consecutive points with two line segments: the first from x1,y1 to x2,y1 and the second from x2,y1 to x2,y2.

See image p. The 3D vectors style is similar, but requires six columns of basic data. A small arrowhead is drawn at the end of each vector.

In both cases, an additional input column 5th in 2D, 7th in 3D may be used to provide variable per-datapoint color information. The keywords " with vectors " may be followed by an in-line arrow style specifications, a reference to a predefined arrow style, or a request to read the index of the desired arrow style for each vector from a separate column.

Note: If you choose " arrowstyle variable " it will fill in all arrow properties at the time the corresponding vector is drawn; you cannot mix this keyword with other line or arrow style qualifiers in the plot command.

See arrowstyle p. Please see set clip p. The xerrorbars style is only relevant to 2D data plots. A tic mark is placed at the ends of the error bar unless set bars is used — see set bars p. The basic style requires either 3 or 4 columns:. An additional input column 4th or 5th may be used to provide information such as variable point color. The xyerrorbars style is only relevant to 2D data plots.

Either 4 or 6 input columns are required. If data are provided in an unsupported mixed form, the using filter on the plot command should be used to set up the appropriate form. For example, if the data are of the form x,y,xdelta,ylow,yhigh , then you can use.

An additional input column 5th or 7th may be used to provide variable per-datapoint color information. The yerrorbars or errorbars style is only relevant to 2D data plots. Either 3 or 4 input columns are required.

The xerrorlines style is only relevant to 2D data plots. The xyerrorlines style is only relevant to 2D data plots. The yerrorlines or errorlines style is only relevant to 2D data plots.

A tic mark is placed at the ends of the error bar see set bars p. Surface plots are generated using the splot command rather than the plot command. The style with lines draws a surface made from a grid of lines. Solid surfaces can be drawn using the style with pm3d. Usually the surface is displayed at some arbitrary viewing angle, such that it clearly represents a 3D surface. In this case the X, Y, and Z axes are all visible in the plot. The illusion of 3D is enhanced by choosing hidden line removal or depth-sorted surface elements.

See hidden3d p. An important special case of the splot command is to map the Z coordinate onto a 2D surface by projecting the plot along the Z axis. See set view map p. This plot mode can be used to generate contour plots and heat maps. This section lists the commands acceptable to gnuplot in alphabetical order.

Printed versions of this document contain all commands; the text available interactively may not be complete. Indeed, on some systems there may be no commands at all listed under this heading. Note that in most cases unambiguous abbreviations for command names and their options are permissible, i. The call command is identical to the load command with one exception: you can have up to ten additional parameters to the command delimited according to the standard parser rules which can be substituted into the lines read from the file.

If found, the sequence is replaced by the corresponding parameter from the call command line. If the parameter was specified as a string in the call line, it is substituted without its enclosing quotes.

Providing more than ten parameters on the call command line will cause an error. A parameter that was not provided substitutes as nothing. Files being call ed may themselves contain call or load commands. The name of the input file must be enclosed in quotes, and it is recommended that parameters are similarly enclosed in quotes future versions of gnuplot may treat quoted and unquoted arguments differently.



0コメント

  • 1000 / 1000