|
From: Ethan M. <eam...@gm...> - 2015-04-03 17:04:14
|
On Fri, Apr 3, 2015 at 3:48 AM, theozh <th...@gm...> wrote: >> Same way. http://gnuplot.sourceforge.net/docs_4.2/node333.html >> >> On Thu, Apr 2, 2015 at 2:19 AM, theozh <th...@gm... >> <mailto:th...@gm...>> wrote: >> >> That's ok for column data... >> But how do you do it with matrix data? > > This works if you have your matrix data in column form: > x1 y1 z1 > x2 y2 z2 > x3 y2 z3 > x4 y4 z4 > ... > > But how do you do operation if you have it in matrix form? > z11 z12 z13 z14 > z21 z22 z23 z24 > z31 z32 z33 z34 > z41 z42 z43 z44 plot $DATA matrix using 1:2:($3<0 ? NaN : $3) with image > To illustrate the strange observation > > If you have a file "Matrix1.dat" > 1 2 3 4 > 2 -3 4 5 > 3 4 -5 6 > 4 5 6 7 > > set palette rgbformulae 7,5,15 > set logscale cb > plot "Matrix1.dat" matrix with image "set logscale cb" has been buggy/inconsistent for a long time. Some fixes went into the code recently, but I am not convinced that it is working consistently even now. I suggest that if possible you re-work your plot so that it does not require log-scaling on the colorbar. Note that the trick shown above (resetting negative values to NaN) will cause the corresponding pixels of a "with image" plot to be omitted altogether - that is, the background color will show through. This is unrelated to the min or max values on the color bar. FWIW, the following seems to give a correct plot in gnuplot 5 although I think the log scaling is not useful in this case: ~~~~~~ $DATA << EOD 1e-8 2e-8 3e-8 4e-8 2e-8 -3e-8 4e-8 5e-8 3e-8 4e-8 -5e-8 6e-8 4e-8 5e-8 6e-8 7e-8 EOD set palette rgbformulae 7,5,15 set logscale cb set cbrange [1e-8:1e-7] plot $DATA matrix using 1:2:($3<0 ? NaN : $3) with image ~~~~~~ Ethan > > The negative values will be displayed with the minimum color, i.e. black > > > However, if you have a file "Matrix2.dat" > 1e-8 2e-8 3e-8 4e-8 > 2e-8 -3e-8 4e-8 5e-8 > 3e-8 4e-8 -5e-8 6e-8 > 4e-8 5e-8 6e-8 7e-8 > > set palette rgbformulae 7,5,15 > set logscale cb > plot "Matrix1.dat" matrix with image > > The negative values will be displayed with the maximum color, i.e. yellow. > > What is the reasoning behind that? > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info |