How do I plot list of tuples in Python?

If I get your question correctly, you could do something like this. >>> import matplotlib.pyplot as plt >>> testList =[(0, 6.0705199999997801e-08), (1, 2.1015700100300739e-08), (2, 7.6280656623374823e-09), (3, 5.7348209304555086e-09), (4, 3.6812203579604238e-09), (5, 4.1572516753310418e-09)] >>> from math import log >>> testList2 = [(elem1, log(elem2)) for elem1, elem2 in testList] >>> testList2 [(0, -16.617236475334405), (1, -17.67799605473062), (2, -18.691431541177973), (3, … Read more

Gnuplot: conditional plotting ($2 == 15 ? $2 : ‘1/0’) with lines

+1 for a great question. I (mistakenly) would have thought that what you had would work, but looking at help datafile using examples shows that I was in fact wrong. The behavior you’re seeing is as documented. Thanks for teaching me something new about gnuplot today 🙂 “preprocessing” is (apparently) what is needed here, but … Read more

Add a single point at an existing plot

There are several possiblities to set a point/dot: 1. set object If you have simple points, like a circle, circle wedge or a square, you can use set object, which must be define before the respective plot command: set object circle at first -5,5 radius char 0.5 \ fillstyle empty border lc rgb ‘#aa1100’ lw … Read more

Line plot in GnuPlot where line color is a third column in my data file?

This following works for me (gnuplot 4.4) plot “./file.dat” u 1:2:3 with lines palette Hope this helps. When I ran your code gnuplot couldn’t pass the “rgb” part. For an example of using the variable tag see the similar question: GNUPLOT: dot plot with data depending dot size with the useful examples found here: http://gnuplot.sourceforge.net/demo/pointsize.html … Read more

Gnuplot plotting data from a file up to some row

It appears that the “every” command in gnuplot is what you’re looking for: plot “filename.txt” every ::1000::2000 using 1:2 with lines Alternatively, pre-process your file to select the rows in which you are interested. For example, using awk: awk “NR>=1000 && NR<=2000″ filename.txt > processed.txt Then use the resulting “processed.txt” in your existing gnuplot command/script.

Hatch patterns in gnuplot

Suppose we want to pattern an area between function y=f(x) >0 and y = 0. It is posiible to create different “patterns” by using the following method. (i) Create a file that has 4 columns (x, y, xdelta, ydelta). This file describes a set of lines with the same slope. (ii) Plot data from the … Read more