Tag Info

Hot answers tagged

7

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 ...


7

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).


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)


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

I think you might want to take a look at the following two: GNUplot Gnuplot is a portable command-line driven graphing utility for linux, OS/2, MS Windows, OSX, VMS, and many other platforms It's probably the number one graphing tool for scientific data (at least where I come from). Here's a list of demos. You sometimes have to prepare the data for it ...


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

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.


4

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

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


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

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

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


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

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" ...


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.


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

much as I value gnuplot, may I suggest ploticus at http://ploticus.sourceforge.net ? have a look at the gallery: http://ploticus.sourceforge.net/gallery/index.html edit: I kinda ignored that fact that you want to build something, and therefore need a C++ example or such. Have a look at audacity: http://audacity.sourceforge.net/ The track display code - ...


1

Not sure if this response will be of relevance anymore but since I wasn't able to find the answer elsewhere I thought I should share this with anyone else who may be stumbling across this page: You can use the data style "steps" to achieve what you would like. The step style maintains your data value until the next sample. You will have two ways of ...


1

I can highly recommend R


1

Gnuplot is a "function plotting program". If you can come up with a function that has pie-like characteristics, Gnuplot will plot it for you. But I doubt that this would be done easily. I'm afraid the answer is: No, that's not possible. Edit: Apparently, that's also what the Gnuplot FAQ says.


1

Here's an example of a pie-chart created with gnuplot. Also, on the same site, you can find another example, including the script used for creating the pie-chart.


1

Have you tried: PlotDrop is available through Ubuntu Software Center http://sourceforge.net/projects/jgp/- Java, so should be compatible http://linux.softpedia.com/downloadTag/Gnuplot+GUI others The second two will probably have to be compiled from source, but that isn't too difficult. The basic steps are: Extract the source Read the README (should ...


1

I did sudo port -d selfupdate sudo port clean gnuplot sudo port install gnuplot and that fixed it.



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