Tag Info

Hot answers tagged

6

You can put labels at a specified offset from the points using the following gnuplot command: echo "plot 'file.dat' using 2:3 pt 2 notitle, '' using 2:3:1 with labels offset 0.5,0.5 notitle;" | gnuplot -persist NB: works only if gnuplot has been compiled with --enable-datastrings (thanks to DaveParillo for the clarification)


6

Supposing that the x values are in the first column of the file 'test.dat' and the y values are in the second column of the same file, than you can operate on the values in the following way: plot 'test.dat' using ($1/n):($2) see the manual for more information and examples on the 'using' keyword. Note that this will not change the values of your data ...


5

I don't think the above answer is very helpful because, as I am writing this, the first google result method is extremely unsatisfactory. It uses gnuplot's ability to read stdout to generate data, so that plot "< echo '1 2'" will put a single data point at the point x=1, y=2. This has several shortcomings that make it just about unusable. First, ...


5

Change the last line to plot f(x)*(x<0.8) + g(x) * (x>=0.8)*(x<0.93) + h(x)*(x>=0.93) I find that easy to read, but it has the disadvantage that all f(x), g(x) and h(x) will always be evaluated. You can also use the ternary conditional operator: condition ? case1 : case2 will evaluate to case1 if condition is true and to case2 if ...


5

If you feed gnuplot its commands from the unix command line, you can also pipe data to it from another program, like zcat which reads in a gzipped file and prints it out, e.g.: zcat datafile.gz | gnuplot -p -e 'plot "-" u 1:2' EDIT: Apparently, in place of a filename, you can give gnuplot's plot command a shell command to run and use the output of. Just ...


5

gnuplot has a set of commands and a set of options for each command. The name of each command and option can be abbreviated to the shortest unique string that describes it, e.g. p for the plot command, sp for the splot command, t for the title option to plot. Note that you can't, for example, use s for splot because it conflicts with set. The two-letter ...


4

Put an empty record (blank line) where there is no data. From the docs: Single blank records designate discontinuities in a plot; no line will join points separated by a blank records (if they are plotted with a line style).


3

xtic, or xticlabels, does not count as a data column. That is why yerrorlines is complaining about not enough columns. You can provide the implicit column 0 for an enumeration. plot "./data.dat" using 0:2:3:xticlabels(1) with yerrorlines


3

Assume your data is in the format: data = { # partition: (frac of disk, frac full) "/": (0.3, 0.9), "/home": (0.7, 0.1), } Try using the reportlab.graphics library (available from the Ubuntu and Fedora repositories as python-reportlab): from reportlab.graphics.shapes import Drawing from reportlab.graphics.charts.piecharts import Pie from ...


2

It can also be done quite simply in Mathematica (tested on the Linux version): data = {{"/", 0.3, 0.9}, {"/home", 0.7, 0.1}}; PieChart[{ Labeled[#[[2]], #[[1]]] & /@ data, Flatten[{Labeled[#[[2]] * #[[3]] , "used"], Labeled[#[[2]] * (1-#[[3]]), "free"]} & /@ data] }, SectorSpacing -> 0] Or if you want the colors to match: ...


2

Gnu plot can't do this alone. I doesn't know what to do with the text. If your data exists in a file named file.dat, then: perl -ane 'print "set label \"($F[0])\" at $F[1],$F[2]\n"' file.dat > label.plt will produce a label file you can use in gnuplot. You can then produce a (very basic) plot like this: gnuplot> load "label.plt" gnuplot> plot ...


2

Turn off X-Windows warnings Report this as a bug to ddd@gnu.org. Give them everything needed to reproduce it.


2

Plotting a Single Point with Gnuplot 1st result for Googling gnuplot plot single point.


2

The fix is here, in Octave 3.4.0 GNU Octave Repository - 2011-04-21 binary of Octave 3.4.0 at SourceForge.net


2

You can use any string that is not a number as value for the missing data points or explicitly specify a missing data string using the set datafile missing command. If you then plot the lines using plot "vikt_ma.txt" using 1:($2) with lines title "first line" then Gnuplot will leave a gap.


2

Found the right syntax, the command is: \$22


2

Yes: gzcat datafile.gz | plot '-' u 1:2


2

plot "DATA" using 1:2:($3-$1):($4-$2) with vectors nohead The vectors style reads four columns (x, y, dx, dy) and draws a vector from (x, y) to (x + dx, y + dy). nohead prevents gnuplot from drawing the arrow head.


2

This is really late, but as I happened across this post, I'll put in my two pennies. Without installing R, we can use call awk within gnuplot: plot "<awk '{print $1, $3}' logfile" u 1:2 where the output of the awk command in the double quotes is used by gnuplot to plot your data. The awk command simply prints out the first and third column. You can ...


2

use the following command, for example, plot "foo" u 1:2 smooth bezier the other options instead of bezier are sbezier, csplines, acsplines. I would just test them for my data and see which one works the best for my purpose.


2

I experimented a bit more and I finally created something that more or less fits my needs! graphmem.sh #!/bin/bash cwd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$cwd" for iuser in $(ps haxo user | sort -u); do [[ $iuser == "root" ]] && continue ps haxo user:64,pmem | awk -v tnow="`date -u +'%H:%M:%S'`" -v user="$iuser" ...


1

You need to put the arrow in front of the image: set arrow front from 0,0 to 1,1 nohead plot 'xyz.dat' with image


1

Basically, you plot surfaces with the splot command. data_file contains your example data points. gnuplot> splot 'data_file' As you want a smooth surface, you have to specify that you want gnuplot to interpolate the data. Here is an example, see http://www.gnuplot.info/demo/dgrid3d.html for some others. gnuplot> set hidden3d gnuplot> set ...


1

Try with set size square This should set the dimension (not scale) of the two axis to be equal.


1

This sets the unit length of both axes to the same value: set size ratio -1 Here is an excerpt from the documentation: set size ratio <r> ... The meaning of a negative value for <r> is different. If <r>=-1, gnuplot tries to set the scales so that the unit has the same length on both the x and y axes. This is equivalent ...


1

In gnuplot, logical expressions evaluate to 1 or 0 as they do in C. Your function above will return 1 if (and only if) the t you pass in equals 0 -- Otherwise it returns 0. The documentation on help operators states: The operators in gnuplot are the same as the corresponding operators in the C programming language, except that all operators accept ...


1

Missed the "/" #!/usr/bin/gnuplot


1

Create a dump of your binary file in a format suitable for gnuplot. For convenience I used hexdump with a custom output format, which we need to store in a file, e.g. as gnuplot.hdp (in principle the format string can get passed via a command line option, but then we will run into too much nested quotes in the gnuplot script): $ cat gnuplot.hdp 3/1 "%03d " ...


1

There is no straightforward way to make an actual histogram, as this is not simply a plotting task but requires that the data be first sorted and binned. You can do that outside of gnuplot and plot the result from gnuplot simply with plot 'file' with histo. Nevertheless, there are two main ways to do what you want entirely within gnuplot. This first is ...


1

GNUPlot seems to work for me on Mac OS X v10.7.3 with an up-to-date MacPorts installation. I didn't have any plot files handy to open, but it launched okay. Make sure your MacPorts environment is completely up-to-date: sudo port selfupdate sudo port upgrade outdated $ gnuplot G N U P L O T Version 4.4 patchlevel 4 last modified November ...



Only top voted, non community-wiki answers of a minimum length are eligible