I am generating figures for a scientific paper, but I have some issues to know what size my figure should have to obtain the correct font size when my figure will be put in my paper.
Currently, to be sure all my figures have the same shape when generated, I use the following function which only allows two size of figures: Rectangle and Square:
def create_figure(shape: Union[tuple, FigureShape] = FigureShape.RECTANGLE) -> Tuple[plt.Figure, plt.Axes]:
"""
Create a basic figure with a normalized shape
This is really useful for all application which need figure
:param shape:
:return: A tuple containing the figure and the main axis used by the figure
"""
plt.style.use(['science', 'ieee', 'vibrant'])
F: plt.Figure
if shape == FigureShape.SQUARE:
F = plt.figure(figsize=(3, 3))
elif shape == FigureShape.RECTANGLE:
F = plt.figure(figsize=(2.6 * (1 + sqrt(5) / 2), 2.6))
else:
raise Exception(f'Unknown shape {shape}')
ax: plt.Axes = F.add_subplot(111)
ax.set_axisbelow(True)
ax.grid(
color='#666666',
linestyle='--',
linewidth=0.3,
visible=True
)
return F, ax
(Note that the content of figsize have been determined randomly for now. I just wanted good looking square and rectangle shapes.)
But there is my issue: my final figures will be presented on a double column paper, and I would like that, when my figure size is reduced to fill one column in width (3.5 inches, see below), the font size of axis labels and legend will be exactly 10px (i.e. the same size as my main text).
According to IEEE recommendations for authors, this is the width images should have depending of the number of column they fill:
- One column width: 3.5 inches, 88.9 millimeters, or 21 picas
- Two columns width: 7.16 inches, 182 millimeters, or 43 picas
I am using Latex to write my paper and PdfLatex for the compilation.
