wikiroute

networking recipes

User Tools

Site Tools


how_to_produce_tikz_plots_for_scientific_publications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
how_to_produce_tikz_plots_for_scientific_publications [2016/01/23 23:45] – created samerhow_to_produce_tikz_plots_for_scientific_publications [2016/01/24 00:16] samer
Line 1: Line 1:
 ====== How to Produce TikZ Plots for Scientific Publications? ====== ====== How to Produce TikZ Plots for Scientific Publications? ======
 +
 +Getting nice plots for scientific publications is not optional. 
 +
 +http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003833#pcbi.1003833-Tufte1
 +
 +<code matlab>
 +figure;
 +x=[1:0.01:10];
 +plot(x,sin(x));
 +xlabel('x');
 +ylabel('sin(x)');
 +</code>
 +        
 +<code matlab>
 +matlab2tikz(sprintf('./output/gt_power_iteration.tex'),'showInfo', false, ...
 +        'parseStrings',false,'standalone', false, ...
 +        'height', '\figureheight', 'width','\figurewidth');
 +</code>
 +
 +\tikzset{font=\footnotesize}
 +\begin{tikzpicture}
 +
 +every x tick label/.append style={font =\footnotesize},
 +every y tick label/.append style={font =\footnotesize},
 +
 +<code matlab>
 +f=figure;
 +boxplot([cum_ee_power_vector_per_user cum_gt_power_vector_per_user cum_maxlog_power_vector_per_user ...
 +    cum_pmax_power_vector_per_user cum_ee_nointerf_power_vector_per_user], 'notch', 'off');
 +set(gca,'xtick',1:5, 'xticklabel',{'Central-EE', 'Distributed-EE', 'Central-SE', 'Max-Power',  'EE-NoInterference'})
 +ylabel('Power (W)');
 +cleanfigure;
 +print(f,'-depsc', sprintf('./output/heur-boxplot-power%s.eps', figure_file_name));
 +savefig(sprintf('./output/heur-boxplot-power%s.fig', figure_file_name));
 +matlab2tikz(sprintf('./output/heur-boxplot-power%s.tex', figure_file_name),'showInfo', false, ...
 +        'parseStrings',false,'standalone', false, ...
 +        'height', '\figureheight', 'width','\figurewidth');
 +</code>
 +
 +<code latex>
 +\usepackage{tikz}
 +\usepackage{pgfplots}
 +\pgfplotsset{compat=newest}
 +\usetikzlibrary{plotmarks}
 +\usepackage{grffile}
 +
 +\newlength\figureheight
 +\newlength\figurewidth
 +
 +\begin{figure}[!h]
 + \centering
 + \setlength\figureheight{0.3\textwidth}
 + \setlength\figurewidth{0.35\textwidth}
 + \input{figures/matlab-fig-tikz/central-dist-boxplot-objective-10users-7sectors-15RBs-20W.tex}
 + \caption{Energy efficiency of the centralized and distributed approaches}
 + \label{fig:central-dist-boxplot-objective-10users-7sectors-15RBs-20W}
 +\end{figure}
 +</code>
how_to_produce_tikz_plots_for_scientific_publications.txt · Last modified: 2016/01/24 00:17 by samer