1

After using this code again for another figure, my recent figure replace with the previous one! Why did this happen? I used IEEEtran.bst format. Please help. Thanks in an advance.

This figure not shown yet.

      \begin{figure}[h]
    \begin{center}
    \includegraphics[height=8 cm,width=.9\textwidth, center]{Logos/figures/dataset_distribution.png}
    \end{center}
    \caption{Three class distribution of our dataset.}
    \end{figure}

This figure show but replace the previous one.

  \begin{figure}[h]
    \begin{center}
    \includegraphics[height=8 cm,width=.9\textwidth, center]{Logos/figures/dataset_pics.png}
    \end{center}
    \caption{Some of the dataset's images with labels}
    \end{figure}

enter image description here

4
  • 1
    Welcome to TeX.SE! Fro code fragment is impossible to say, what is going wrong in your document. We can help you only if you provide small but complete document, which reproduce your problem.
    – Zarko
    Commented Jan 20, 2021 at 16:17
  • @Zarko Is it okay now? Commented Jan 21, 2021 at 4:32
  • Thanks for your reply. But dataset_pics and dataset_distribution are different images. But not show two of them in each section. but different section It shows. Like: in 3.1 section not shows two of them. I really need help! don't understand how can I write in this community ! Commented Jan 21, 2021 at 7:36
  • I extend my comment to an answer (bellow). Please see it.
    – Zarko
    Commented Jan 21, 2021 at 7:39

1 Answer 1

1

To long for the comment:

We ask you for complete small document, which reproduce your problem. Such document is here named as Minimal Working Example (MWE). An example of MWE with containing your (corrected) code fragments is:

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\begin{figure}[ht]
\centering
\includegraphics[height=6cm,width=.9\textwidth]{example-image-a}
\caption{Three class distribution of our dataset.}
\label{fig:distribution}
\end{figure}
    
\begin{figure}[ht]
\centering
\includegraphics[height=6cm,width=.9\textwidth]{example-image-b}
\caption{Some of the dataset's images with labels}
\label{fig:imageset}
\end{figure}
As you can see, figure \ref{fig:imageset} is not equal to figure \ref{fig:distribution}!
\end{document}

which produce:

enter image description here

As you can see, images are different. This means, that the cause of your problem are not in provided code fragments. Please check if the image file dataset_pics contain the same picture as file dataset_distribution. If they are different, please provide MWE which will reproduce your problem.

Note:

  • Your code fragments use undefined option center which cause error, so remove them (as is done in my MWE).
  • Use center environment introduce additional vertical space, therefore is better to use command \centering (see MWE).
  • I reduce image height that they can appear on the same page.
  • you not need to declare image file name extension (.png).
3
  • Thanks a lot @Zarko. It's work now when I change in - includegraphics[height=6 cm,width=.9\textwidth,center] - with height 6cm with replace previous 8 cm. Thanks a lot once again. I want to upvote but now newbie. Commented Jan 21, 2021 at 10:22
  • @Md.AsifIqbalFahim, you are welcome! BTW,. you can already accept answer (and receive some reputation :-) )
    – Zarko
    Commented Jan 21, 2021 at 10:51
  • Thanks a lot Sir. Always remember your kind support. Best wishes for you. Commented Jan 21, 2021 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .