Graphics, Figures & Tables ⇒ width=\textwidth do not scale PNG image correctly
width=\textwidth do not scale PNG image correctly
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.
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
width=\textwidth do not scale PNG image correctly
Thanks. have attached the image.Johannes_B wrote:Welcome, you could upload the picture file so we can investigate directly with the file.
- Attachments
-
- This image does not scale correctly
- plot.png (91.59 KiB) Viewed 8521 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: width=\textwidth do not scale PNG image correctly
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.