garrettj403 / SciencePlots

Matplotlib styles for scientific plotting
MIT License
6.96k stars 700 forks source link

How to setup style for two-column figures? #91

Closed flydream0428 closed 1 year ago

flydream0428 commented 1 year ago

Is there a way to set up styles for two-column figures? If I create a figure with a width of 15 cm, the font size will be too large.

echedey-ls commented 1 year ago

It would be nice to have an example, so we can test with it and give advice according to it. Anyway, I suppose you are using the IEEE style, known for having issues with the DPI. In that case, you can save the figure (I believe it didn't mess up with the DPI scaling, the viewer does), don't use the IEEE style or modify the text properties via code commands:

  1. fig.suptitle('Title', **{'fontsize': 'medium'}) See matplotlib reference
  2. ax.set_title('Axes title', , **{'fontsize': 'small'}) See matplotlib ref Allowed values for fontsize are here.

Hope to have helped you, feel free to reopen if necessary.

Edit: I forgot to add that you can also modify the DPI scaling after plt.style.use(...) with

plt.rcParams.update({
        'figure.dpi': '100' # Default DPI value
})

(see issue #60)

flydream0428 commented 1 year ago

Thanks for the reply. After some further testing, I realised that many things could be achieved by adjusting the DPI. I guess I need to get more familiar with all the settings before I submit the issue here. I will reopen one if I need more help.