Graphics, Figures & Tableswidth=\textwidth do not scale PNG image correctly

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
stridder
Posts: 6
Joined: Sun Mar 13, 2016 9:43 am

width=\textwidth do not scale PNG image correctly

Post by stridder »

Hello,

I am including PNG plots that are obtained from MATLAB figures with 600dpi resolution.
I use
\includegraphics[width=\textwidth]{image}
command inside a figure.
The page where the image should be shows only figure caption, which is I believe due to image not being scaled and therefore too big (image resolution 4800x3600 though its size only 90K). I came to such conclusion b/c image fits the page only when I out 0.05 factor like this:
\includegraphics[width=0.05\textwidth]{image}
Also tried \linewidth instead of \textwidth and tried putting \makebox[\textwidth] around \includegraphics command. But the behaviour is the same.
How can I make it scale to the page width without playing with scaling multiple?
Could 600dpi resolution be the issue?

The whole document is quite big, its type is:
\documentclass{report}
Resulting format of document PDF. Build commands: latex.exe +dvipdfm.exe on Win7
Please let me know if I should add other details.
Tried to google for several hours, couldn't find exactly this issue.
Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: width=\textwidth do not scale PNG image correctly

Post by Johannes_B »

Welcome, you could upload the picture file so we can investigate directly with the file.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
stridder
Posts: 6
Joined: Sun Mar 13, 2016 9:43 am

width=\textwidth do not scale PNG image correctly

Post by stridder »

Johannes_B wrote:Welcome, you could upload the picture file so we can investigate directly with the file.
Thanks. have attached the image.
Attachments
This image does not scale correctly
This image does not scale correctly
plot.png (91.59 KiB) Viewed 8518 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: width=\textwidth do not scale PNG image correctly

Post by Johannes_B »

The image scales down perfectly. Nothing strange to report. Can you give more details?

By the way, using such huge images just blows up the file size of the pdf without adding any detail, you could use much smaller images. Or generate the diagrams from within LaTeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply