49

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.

8
  • 13
    IANAL, but I would be very surprised (shocked really) if you have to attribute the SO post for publishing the graph you created from your data using it. I would attribute R (using the output of 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.
    – Roland
    Commented Aug 4, 2014 at 9:57
  • 6
    Would this be on topic at academia.SE? Commented Aug 4, 2014 at 17:48
  • I think you should read the terms of service of StackOverflow. That should answer your question better than the guesses below, or at least be a sounder starting point. stackexchange.com/legal
    – matanox
    Commented Aug 4, 2014 at 18:12
  • 2
    All scientific work as described is protected as Fair Use and you should not waste even once second worrying about the copyright trolls. Entirely apart from that, it's your own work. Commented Aug 5, 2014 at 14:16
  • 2
    Um, fair use doesn't even exist in many countries, and it's hardly automatically protected against all uses (obvious example, you can't take someone else's work and republish it in its entirety as your own).
    – Joe
    Commented Aug 5, 2014 at 16:14
  • Aren't all StackExchange sites all licensed CC-BY? Commented Aug 6, 2014 at 14:04
  • @criticalfix I believe "Fair Use" is a US legal term. The term and the rights it encapsulates doesn't necessarily apply in all the places people who ask and answer questions here are from. If the original poster is in Senegal and the answerer is in Australia (say), what you assert to be protected by fair use may not necessarily be of help. What good is a US legal doctrine if they're not in the US? The SO terms of service and licensing may have some standing as a contract, but US legal protections like fair use may have little bearing on them.
    – Glen_b
    Commented Aug 6, 2014 at 22:42
  • follow-up to the answer below (should it be accepted?): it's always nice to thank someone, it's great to thank the community by reference to stackoverflow and other places you might have received help from (including X generations of students/colleagues at Institutions Y), and it's also nice to name specific individuals if you have their consent. I've done that before and never got into trouble for thanking.
    – PatrickT
    Commented Jan 6, 2015 at 6:35

1 Answer 1

23

I'm not a lawyer but my guess is that the license of the content at SO is irrelevant here since you do not publish the content of SO itself but only a work created by the content. The work itself (the figure) is in my opinion not subject to the license - it's fully yours. I think that everything you can achieve with the content published here is not affected by the content license, only the content itself.

However for many scientific publications they want that you specify all relevant contributions. This has nothing to do with the license used here but with good scientific conduct.

However a bit of code for displaying a figure nicely probably wouldn't qualify as relevant contribution.

If you insist on something:

The author acknowledges the help of the StackOverflow community in the display of the data.

should be fine.

4
  • 13
    +1 If software/code licenses were relevant for what you produce with the software, I'd be more concerned about using Excel than some code with a free license.
    – Roland
    Commented Aug 4, 2014 at 11:36
  • 1
    @Roland What about licenses for software that say it's not for commercial use? Commented Aug 5, 2014 at 23:18
  • @JakubKania Please ask a lawyer if you have a specific case in mind. The question is about scientific use, which usually isn't commercial.
    – Roland
    Commented Aug 6, 2014 at 7:01
  • 1
    @Roland yes, however I am just pointing out that it seems there are cases where license matters for what you produce with software. Commented Aug 6, 2014 at 10:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .