Re: Re: Creating graph with only a view data points
- To: mathgroup at smc.vnet.net
- Subject: [mg28936] Re: [mg28905] Re: Creating graph with only a view data points
- From: Hugh Goyder <goyder at rmcs.cranfield.ac.uk>
- Date: Sat, 19 May 2001 22:27:53 -0400 (EDT)
- References: <9dqdf2$4j7@smc.vnet.net> <9dta7t$f60@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Oliver, try this As you do not have a singled value function, you cannot use Plot. However, ListPlot with the option PlotJoined -> True will join up your points. Note the need to include PlotRange -> All otherwise extreme points will be cut off. (I usually change the default option so that I see all my points.) This may be good enough for your purposes. However, if you want smoother curves you will have to use some interpolation. Split out the x and y values and make interpolations for each set of points using the point number as the dependent variable. Finally, use ParametricPlot to plot the curve as a function of point number. You can try using different amounts of smoothing by setting InterpolationOrder to 1,2 3 etc but it is better to try to use more points in the original data set. I hope the example below is clear (plots removed for simplicity). Hugh In[19]:= data = {{0, 0}, {1, 0.5}, {2, 0.5}, {3, 0.5}, {2.1, 1.5}, {1, 5}}; In[20]:= p1 = ListPlot[data, PlotJoined -> True, PlotRange -> All]; (* if you wish to have smooth curves *) In[21]:= xx = Interpolation[Transpose[data][[1]]]; yy = Interpolation[Transpose[data][[2]]]; In[23]:= p2 = ParametricPlot[{xx[r], yy[r]}, {r, 1, 6}, PlotRange -> All]; In[24]:= Show[p1, p2, PlotRange -> All]; At 01:13 18/05/01 -0400, you wrote: >First of all thanks for your help. >I'm sorry, but your solution don't work in my case. >It could happen, that I have to go back on the x and y axis. >For example: > >{{0,0},{1,0.5},{2,0.5},{3,0.5},{2.1,1.5},{1,5}} > >Mathematica isn't realy happy with that. > >Do you, or anybody else, have a solution for that? > >Greetings Oliver > >> >>Hi, >> >>Needs["Graphics`Legend`"] >>(* Enter the data *) >>data = {{-1, 0.1}, {-0.5, 0.15}, {-0.25, 0.5}, {0, 1}, {0.25, 2}, {0.5, >>4}}; >>(* make a smooth function *) >>ip = Interpolation[data] >> >>(* plot the data *) >>Plot[ip[u], {u, -1, 0.5}, PlotLegend -> {{"Some Function"}}] >> >>Look very complicated! >> >>Regards >> Jens >> >> >>Oliver Tonn wrote: >>> >>> Hello, >>> >>> I'm a student at a school for technicians (electronic). I'm making my >>> calculations with Mathematica. >>> For a documentation I want to create a graph with the characteristic of a diode >>> and a transistor. I'm looking for a software, with which I only have to enter >>> some significant points of the graph, the scale, and the legend. Then the >>> software should create the graph. >>> Does anybody know a software which could do that, or is it possible to do this >>> with Mathematica. >>> >>> Greetings Oliver >> > > > >