Plotting labeled intervals in matplotlib/gnuplot

Updated: Now includes handling the data sample and uses mpl dates functionality. import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter, MinuteLocator, SecondLocator import numpy as np from StringIO import StringIO import datetime as dt ### The example data a=StringIO(“””a 10:15:22 10:15:30 OK b 10:15:23 10:15:28 OK c 10:16:00 10:17:10 FAILED b 10:16:30 10:16:50 OK “””) … Read more

Plotting two axes in gnuplot

You can have the axes handled automatically without you having to scale them yourself and keep auto-scaling: set terminal jpeg set output ‘graph.jpg’ set xrange [-10:10] set ytics 10 nomirror tc lt 1 set ylabel ‘2*x’ tc lt 1 set y2tics 20 nomirror tc lt 2 set y2label ‘4*x’ tc lt 2 plot 2*x linetype … 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.

Plot window not responding

The problem is likely to be the graphics toolkit which your installation of Octave is using. To check this, type graphics_toolkit in the Octave command line. If the response is fltk and your plot window is freezing, then switch the default toolkit to gnuplot: graphics_toolkit(‘gnuplot’) Test that the problem is fixed: x=1:10; y=x.^2; plot(x,y) Make … Read more

Minimizing NExpectation for a custom distribution in Mathematica

As far as I see, the problem is (as you already wrote), that MeanResidualLife takes a long time to compute, even for a single evaluation. Now, the FindMinimum or similar functions try to find a minimum to the function. Finding a minimum requires either to set the first derivative of the function zero and solve … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)