This is an old revision of the document!
Datafile: conditional_plotting.txt.
Using Gnuplot, generate two separate bar graphs for the following:
The ratio is considered to be high enough when $6/$4 > 1. This will help you spot the people who live less healthy. The graphs should be as complete as possible (title, axes names, etc.).
Datafile: health.txt
Use Gnuplot to generate the following graphs:
Datafile: time_data.txt
Using the code provided in “Tutorial 03. Time-based data when plotting in gnuplot”, use the histogram style, and format the xtic labels using strftime and timecolumn.
set timefmt "%H:%S" set style fill solid 0.6 border -1 set style data histogram set style histogram clustered gap 1 plot 'data.dat' using 2:xtic(strftime('%H', timecolumn(1))), \ '' using ($2*0.5), \ '' using ($2*0.7)
Datafile: histograms.txt
Using Gnuplot, create multiple histograms with 'set style histogram' and 'boxes'.
Create a simple bar graph. Remember to make the lines solid.
Datafile: animations.txt
Datafile: heatmaps.txt
Using Gnuplot, create heatmaps using:
Create heatmap WITHOUT interpolation;
Datafile: heat_map_data.txt
Use Gnuplot to create three 2D maps in a single 3D graph. Export the result as a .pdf file (using gnuplottex package) and include also a \caption{Describe how you did the exercise}. Hint: You have to give the splot command 4 pieces of information: the x, y, and the z coordinate,and the value for the color.
set view 55,110 splot "heat_map_data.txt" matrix u 1:2:(-0.5):3 w image, \ "" matrix u 1:(-0.5):2:3 w image, \ "" matrix u (-0.5):1:2:3 w image
Create myscript.tex and add the lines below. You should put in your 'begin{gnuplot}…end{gnuplot}' your solution for plotting. The main advantage for using gnuplottex is that you are allowed to use gnuplot directly inside the .tex file.
\documentclass[a4paper]{article} \usepackage{gnuplottex} \begin{document} \begin{gnuplot}[terminal=pdf,terminaloptions={font ",10" linewidth 3}] plot sin(x), cos(x) \end{gnuplot} \begin{gnuplot}[scale=0.8] set grid set title 'gnuplottex test $e^x$' set ylabel '$y$' set xlabel '$x$' plot exp(x) with linespoints \end{gnuplot} \end{document}
Compile it! Your final result should look like this: myscript.pdf.
#compile with pdflatex --shell-escape myscript.tex
Observations: If gnuplottex is missing, here is gnuplottex.sty