I am currently learning R and ggplot2 to generate a figure for a scientific publication. In the learning process I asked a few questions on how to create specific plots. How can I use the figure form the code I derived from the answers I got on Stack Overflow in my publication (which probably will not be released under cc by-sa 3.0)?
Do I need to contact the user that gave me the answer in order to ask for their consent?
Am I subjected to the license if the "solution" (sometimes basic) was used, but not the code itself? (no copy/paste!)
When is code copyrighted and when is it just the "natural use" of the programming language? I don't think copyright applies on something like print('hello world')
, but is there a limit that is usually accepted?
I came across this post and wiki where I feel the situation discussed is similar and where the distinction between "using" and "publishing" the code is made. I would also like to stress that I am talking about 4-5 lines of code which probably are under the "snippets" category or about language 'tricks'. I would find useful if Stack Overflow people would give some real life example of how they expect this licencing to be implemented with some fair use/unfair use situation.
citation()
) and possibly the ggplot2 package (though usually I don't). I might mention an SO post in the acknowledgments if it was particularly helpful.