0

I'm looking to plot Data between two columns, First row has a funtion of x^2 and second has value of x = {1,2,3,4,5}

So I have now two rows with Data one {1,3,9,16,25} and another {1,2,3,4,5}

Is below the correct way to show the above data on Graph in short form without very long process.

Show[Plot[x^2, {x, 0, 10}], ListPlot[{{1,2,3,4,5}]]

If it is then what are the other ways to plot the Graph and If it isn't then what does above function do or what it tells mathematica to perform?

Here is the image to make it more clear of what I want

enter image description here

Thanks in advance.

Bir Nepali
  • 429
  • 1
  • 8
  • 20
  • 1
    `ListPlot[{{1,3,9,16,25},{1,2,3,4,5}}]` – Bill May 04 '18 at 18:37
  • @Bill actually I was looking to plot a function which has an variable x and x value ranges from 1,2,4,5. let us conside the function be y. Now when I add the x value in funtion y.....I now have 4 value of y and already I have 4 value of x. Now I want to plot the graph between x and y. So I was looking for a short method which will do the trick i.e it will be reduce to single step solution rather then two step solution....and somewhere I found the above formula....does it work that way....? can you please explain it little. – Bir Nepali May 04 '18 at 18:45
  • I think you want `ListPlot[Transpose@{{1,2,3,4,5},{1,3,9,16,25}}]` – agentp May 04 '18 at 19:13
  • It seems difficult for us to understand each other. Can you show an example function or describe what result you want from this function when it is give it 4? Can you clearly describe exactly what will be plotted with your 1,2,4,5 input? Perhaps ignore Mathematica for a minute and just describe in math what it is that you want. – Bill May 04 '18 at 19:16
  • @Bill I have added image of it explaining of what I want...Hope it helps to understand the problem better and more clear. – Bir Nepali May 05 '18 at 01:02
  • 1
    Perhaps this will help you do this in one step `ListLogLogPlot[{#,Sqrt[3#/2]}&/@{2,10,10^4,10^6,10^8,10^16}]` or perhaps this will be easier to understand by defining your function separately and then using the function name to create the plot `f[x_]:={x,Sqrt[3x/2]}; ListLogLogPlot[f/@{2,10,10^4,10^6,10^8,10^16}]` – Bill May 05 '18 at 02:05
  • @Thanks Bill for your help. – Bir Nepali May 05 '18 at 02:28

0 Answers0