You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While it is in principle already possible to save the figure as a (vectorized) pdf file, the resulting plot needs more fine-tuning. Especially, the fonts are too small and partly misaligned (in the legend).
fromsolarmachimportSolarMACHbody_list= ['STEREO-A', 'Earth', 'BepiColombo', 'PSP', 'Solar Orbiter', 'Mars']
vsw_list= [400, 400, 400, 400, 400, 400, 400] # position-sensitive solar wind speed per body in body_listdate='2021-10-28 15:15:00'filename='Solar-MACH_'+date.replace(' ', '_')+'.pdf'sm=SolarMACH(date, body_list, vsw_list)
fig, ax=sm.plot(numbered_markers=True, return_plot_object=True, outfile=filename)
Yeah, it may well be that tight_layout() or bbox_inches="tight" interfere with that. Or it could also be related to the dpi=200 setting used while creating the figure...
Would be great if we can get the plots to look the same between PDF and PNG. Maybe it is also worth considering not to use tight_layout() and bbox_inches="tight" at all here to achieve reproducible figure size and margins.
Yes, I think the way to go is to set everything manually and forget the automatic things. As I mentioned, I think they don't do anything with pdfs, and then it's hard to have comparable results... At least the DPI settings are completely ignored for the vector graphics.
While it is in principle already possible to save the figure as a (vectorized) pdf file, the resulting plot needs more fine-tuning. Especially, the fonts are too small and partly misaligned (in the legend).
PDF file:
Solar-MACH_2021-10-28_15:15:00.pdf
Corresponding PNG file:
(In the code
plt.savefig
is used withbbox_inches="tight"
- does that work for pdf files?)The text was updated successfully, but these errors were encountered: