Tag Info

Hot answers tagged

10

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


9

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


8

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


6

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


6

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


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

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.


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

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.


4

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


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

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


2

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


2

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.


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

If you can write a command that can calculate the function you need, then you're done: gnuplot> f(x) = real(system(sprintf("echo %f", x))) gnuplot> plot f(x) (see help system) So you can use e.g. octave to calculate your value. E.g., if your system is linux, you can have directly: gnuplot> bJ(a,x) = real(system(sprintf("echo 'besselj(%f,%f)' | ...


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

In general in gnuplot there are at least 5 mode to make persistent the execution of a script, from inside and from command line Put a pause -1 after the plot command in the file, or at the file end. Use command gnuplot filename.gp - (yes, dash is the last parameter) to stay in the interactive regime when the script completes. Run gnuplot as gnuplot ...


1

Before of all you need to be sure that gnuplot is crashing. To do it just run your command and after ask to the shell the exit code with echo $? gnuplot -e "plot 'data.dat'" echo $? If it returns 0 it means the execution finished without error. The -persist parameter can fix your problem. gnuplot -persist -e "plot 'data.dat'" If it returns a number ...


1

Blender and Gnuplot are rather different kind of program. From Blender's site you can read It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking, even video editing and game creation. Advanced users employ Blender’s API for Python scripting to customize the application and write ...


1

I can highly recommend R


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



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