Copyright of reproduced figure which is based on data from other sources I'd like to include a figure in an open-source journal, which looks very similar to a figure already published in another paper (paper 1). My question is if I need to obtain the permission to reprint the figure, or, if a "based on paper 1" in the figure legend is sufficient for including the figure in my manuscript.

The figure is based on experimental data from another source (Example et al. 2018; see the example plot) and a line which shows the results with their code (code 1).

My figure uses the same experimental data, but another code (code 2), which makes use of data in the original paper (paper 1) and therefore has the exact same curve as code 1.

Example plot

Thanks in advance!
If you literally reprint the older figure you need permission. However, if you generate a figure from data (that is properly cited) using a different algorithm, then the similarity of the figures is a coincidence. In such a case you have a new figure, not a copy of the old one. 

There is another factor that may come in to play here. There is, if  I remember correctly, an exception in copyright law for things that can be stated in only one way. If there is only one way to say something, I believe the legal doctrine is, you can't copyright it. But I'm not a lawyer.

But if both the data and the algorithm are from the old paper it is murkier and you may need legal advice. A university research office can probably help. 

"Looks very similar" is not the standard for copyright. 

But your explanation of the figure's source should be clear from how you present it in your paper to avoid a claim.