Samstag, 17. Januar 2015

plot color of data point with z-value

To plot a x,y,z data file with the z-value being the color value of the x,y data point use "with linespoints palette" as following:

plot 'test.dat' u 1:2:3 with linespoints palette 

An example is shown below:

Donnerstag, 15. Januar 2015

gnuplot use figure with alpha channel

Sometimes it is desirable to plot data on top of a figure or a figure on top of a graph. In the latter case the figure has to be transparent so that the plotted data is still shown. This can be achieved via the "with rgbalpha" option as shown in the following:
plot "partly_transparent_figure.png" binary filetype=png  with rgbalpha

round numbers in tikz with pgfmath

To round numbers using pgfplots in the tikzpicture environment use \pgfmathparse to calculate the desired value and then print it to with \pgfmathprintnumber or print it to a variable with \pgfmathprintnumberto and use the optional parameter precision, as shown in the following:
\pgfmathparse{10.042/1.54}
\pgfmathprintnumberto[precision=2]{\pgfmathresult}{\value}
\value