0

I have a .dat file which I want to fetch the median data points to plot my figure. However the y-axis is giving issues. here is my code. and attached is the data file.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}% optional T1 font encoding

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{pgfplots}
\usepackage{tikz} 
\usepackage{graphicx}
\usepackage{subfigure}
\title{plots of images: Image completion }
\usepackage{natbib}
\usepackage{graphicx}
\begin{document}
\maketitle
\section{Introduction}
\begin{figure}[ht]
    \resizebox{0.24\textwidth}{!}{\begin{tikzpicture}
            \begin{semilogyaxis}[
                ticklabel style = {font=\Large},
                ytick={1,10,20,60},
                ymax=60,
                ymin=1,
                xmin=10,
                xmax=90,
                xlabel=\large{Iterations},
                ylabel=\large{RRE},
                title={NeNMF perf. w.r.t. different ranks (i.e. r=5,10,50)}
                ]
                \addplot[green,line width=2pt] table[x expr=\coordindex, y=Med_V_NeNMF, col sep=space]{Envelop_1000_5.dat};
                
                \addplot[blue,line width=2pt] table[x expr=\coordindex,y=Med_ARPI_NeNMF, col sep=space]{Envelop_1000_5.dat};
                
                \addplot[red,line width=2pt] table[x expr=\coordindex,y=Med_RPI_NeNMF, col sep=space]{Envelop_1000_5.dat};
                
                \legend{{vanilla ($r = 5$)},{ARPI ($r = 5$)},{RPI ($r = 5$)}}
            \end{semilogyaxis}
            
        \end{tikzpicture}
    } \hfill
    
    \caption{NMF performance with respect to compression techniques.}  
\end{figure}
  
\end{document}

Link to data file: https://www.sendspace.com/file/pru1dg

3
  • Please make your document example compilable. For example, in preamble include rank_tests_dat/Envelop_1000_5.dat accordingly – Zarko Sep 7 '20 at 13:42
  • Hello @Zarko ive edited it. That was just a link to where I kept my .dat files. I have also attached a link to download my .dat file for compiling. sendspace.com/file/pru1dg – Farouk Yahaya Sep 7 '20 at 13:51
  • 2
    Just drop the ymin and ymax. Pgfplots will determine them from the data BEFORE it starts to draw anything. – John Kormylo Sep 7 '20 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.