Standard naming of scripts and figures
Opened this issue · 3 comments
jkeune commented
Hi all,
browsing through this repo and the plots on the Leiden driven a few days after the workshop, I am having trouble finding the same plot for all cases (just by the name) and the script that created a specific figure. Can we also introduce a rough naming convention for scripts and figure files?
jkeune commented
chrisweij commented
Thanks, that is a good point, one suggestion could be:
FigNumber_plotname_case.png
E.g. Fig3_MoistureSources_Pakistan.png
I don't think we would need a version number anymore.
Peter9192 commented
Just an idea: perhaps we could also add some metadata to each of the figures? I see two ways in which we could do that.
- A sidecar file, same name as the figure but different extension, with some metadata. This is common e.g. for several image formats.
- Add metadata into the PNG directly. That is supported by matplotlib, but it requires more effort to get it out.
Example for option1:
plt.savefig("Fig3_MoistureSources_Pakistan.png")
with open("Fig3_MoistureSources_Pakistan.txt") as sidecar:
sidecar.write("This figure show ....")
Example for option 2 (see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html):
metadata = {
"Title": "Moisture sources Pakistan",
"Description": "This figure shows ...",
}
plt.savefig("Fig3_MoistureSources_Pakistan.png", metadata=metadata)