From: Sean M. <sma...@gm...> - 2014-09-08 00:38:14
|
Hi, I would just like to report my experience / trouble so that others may find solace if they have a similar problem. I have code which makes a basic 2 dimensional Gaussian function. I want to make a basic surface plot of this function, just to see what it looks like. I have found that using Gnuplot.GridData function with the optional filename argument enabled, so that it creates a permanent file, works. If I leave out the "filename=test.bin" option, the program defaults to the temporary FIFO class, and Gnuplot (4.6) is unable to read and properly facorize the matrix. My code, as a sample: [code] #!/usr/bin/python2 import Gnuplot import numpy as np g1 = Gnuplot.Gnuplot(debug=1) #Let's try making a single contour plot of a windowing function, using #Gnuplot. t = np.linspace(-1000, 1000,2001) / 1e5 tc = 0.004 ts = t [Xg,Yg] = np.meshgrid(ts, ts) corr2win = np.exp(-(Xg/tc)**2 - (Yg/tc)**2 - (Xg * Yg) / (tc)**2) #Plot the window using GNUPlot. g1.title('2 Dimensional Windowing Function') g1('set parametric') g1('set dgrid3d 20, 20, 1') g1.xlabel('Time (s)') g1('set hidden3d') g1('set style data lines') g1('set pm3d') g1.ylabel('TIme (s)') g1.splot(Gnuplot.GridData(corr2win, ts, ts, binary=1, filename='test.bin')) [/code] If I run the splot command without the filename flag in GridData, I get the following error: line 0: File doesn't factorize into full matrix My relevant version information is (all x86_64 builds where applicable): Kernel: x86_64 Linux 3.16.1-1-ARCH Python2.7.8 Ipython 2.2.0 gnuplot 4.6 python2-gnuplot 1.8.3 (as found on the AUR: https://www.archlinux.org/packages/community/any/python2-gnuplot/ Anyways, I'm just putting this out since I didn't find anyone else with a similar problem. Hope this helps. Cheers, Sean |