Re: combining two plots
- To: mathgroup at smc.vnet.net
- Subject: [mg16768] Re: [mg16708] combining two plots
- From: Jorge Zickermann <jzickermann at mail.EUnet.pt>
- Date: Wed, 24 Mar 1999 02:24:07 -0500
- Organization: Personal
- References: <199903230333.WAA07275@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Joaquim,
Suppose you have the following points;
xvalues = {0,2,6,8,9,15}
yvalues = {3,5,2,11,12,8}
and the discrete plot of them;
plotdiscrete =ListPlot[Evaluate[Transpose[{xvalues,yvalues}]]]
If you fit these points, for example, with a 3rd order polinomial;
function=Fit[Transpose[{xvalues,yvalues}],{1,x,x^2,x^3},x]
and plot that continuous function;
plotfunction = Plot[function,{x,0,15}]
To plot both the discrete and continuous plots together just do;
Show[plotdiscrete,plotfunction]
Boa sorte,
Jorge
Joaquim Leitao wrote:
> Hello:
>
> I'd like to draw in the same plot a function and some discrete
> points. How can I combine the ListPlot and Plot comands in the same
> figure?
>
> Any help will be appreciated
> Joaquim Pratas Leitao
> Departamento de Fisica
> Universidade de Aveiro
> 3810 Aveiro, Portugal
> tel: +351 34 370286
> e-mail: quim at fis.ua.pt
- References:
- combining two plots
- From: "Joaquim Leitao" <quim@ideiafix.fis.ua.pt>
- combining two plots