How do I combine the graphic of a ListPlot with the graphic of a Plot?

后端 未结 2 902
隐瞒了意图╮
隐瞒了意图╮ 2021-02-19 11:39

Is there a way to combine the graphic of a ListPlot to the graphic of a Plot? (I need to plot a graphic of a function on the graphic of a ListPlot)

2条回答
  •  悲&欢浪女
    2021-02-19 12:12

    You can combine any graphics with the Show function like so:

    Show[myListPlot, myPlot]
    

    This generalizes to combining any number of plots at once: Show[p1, p2, p3, p4, ...] or Show[{p1,p2,p3,p4,...}]


    Reference and image source: http://reference.wolfram.com/mathematica/ref/Show.html

    enter image description here

    enter image description here


    You can use Epilog as well if Show is not stacking the graphics in the correct order, but combining more than 2 graphics with Epilog will be unwieldy.

提交回复
热议问题