I need to create a figure in latex, which I want to extract as a PNG.
My latex code:
\documentclass{article}
\usepackage{svg}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[papersize={1000px,1000px}]{geometry}
\pagestyle{empty} % Remove page numbers
\begin{document}
\begin{figure}
\centering
\subfloat[Noisy Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:noisy}}\hfill
\subfloat[Good Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:good}}\\
\subfloat[Nice Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:nice}}\hfill
\subfloat[Signal Plot]{\includesvg[width=0.5\textwidth]{test.svg}\label{fig:signal}}
\caption{My test plots}
\label{fig:four-plots}
\end{figure}
\end{document}
Result:
Problem: The width of the page must exactly be 1000 pixels. The width of the plots should be adjusted accordingly (while maintaing the aspect ratio). But when I convert the PDF to PNG, the dimension of the PNG is 2778 x 2778 pixels. How do I enforce the dimension to have a width of 1000 pixels?
-size
option within ImageMagick'sconvert
.