I have two images which I try to include in tex (greater context: trying to convert ipython notebook to tex which also has output images). I find a weird scaling problem. Both images are comparatively similar, only one is little lower. The lower one is scaled too low, lower than its normal size, while other one is scaled fully.
This is without any size specification. Below is the code. I have also given the separate links to images so one could MWE.
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
\includegraphics{24_confidence_intervals_shallow_examples_files/24_confidence_intervals_shallow_examples_5_0.png}
\includegraphics{24_confidence_intervals_shallow_examples_files/24_confidence_intervals_shallow_examples_8_0.png}
\end{document}
Below is the output (pdf):
I initially thought it would be something to do with ipython (in fact it messes up with includegraphics width), so I isolated using above code, and thus individually also, my first shorter image is treated badly. Why is it so? :(
To isolate further, I also tried the same in online IDE but still same output. Please check it here
Here are the 2 images for you also to try:
1. Problematic png image
2. Normal png image
Afaik, image is not a problem as they appear correctly on notebook. Why tex shrinks the former image is the question to be tackled.
Constraint: I could add a custom width to adjust this misbehaving images but I do not want to do that (its normal sized in the notebook) mainly because ipython has redefined includegraphcis and I do not want to mess with that. Probably if max image size restriction if any there for this latex issue needed, I could try to make my script generating the problematic image to keep it of that or within that size.
Update: First doubt: I rechecked document properties again as hinted in comments, and find that the problematic image's size in cm are low compared to other image's size in cm. I have created a ticket for tikzmagic on that as well, here. however, currently tikzmagic does not support altering size in cm afaik, so looking forward if anything could be done from tex side.
png
files. If you specify an option, such as[width=5cm]
to yourincludegraphics
calls, both pictures should have the same width. To get a more accurate sizing, I guess you should setup things in pythonmatplotlib
surely can handle this.