0
$\begingroup$

Hello I have a more pragmatic problem. Let's start from the beginning so everyone knows what I mean.

I have a listplot such that

ListPlot[Table[funct1[1, b, 4][[8]], {b, 0.01,temp, 0.1}]]

The function: funct1[[8]] gives me pairs of results {t,V} for every [a,b,c]. Now all that I initially wanted was to keep a=1 and c=4 fixed, just run b from 0.01 to some endvalue and plot the results with V on the y-axis and t on the x-axis.

This works perfectly well. Then I got ambitious and thought I might wanna manipulate the end value temp where the Table stops

 Manipulate[ListPlot[Table[funct1[1, b, 4][[8]], {b, 0.01,temp, 0.1}]],{temp, 0.1, 10, 0.1}]

Then I got even even more ambitious and wanted to see if I can manipulate a and c aswell. Turns out I can!

Manipulate[ListPlot[Table[funct1[a, b, c][[8]], {b, 0.01,temp, 0.1}]],{temp, 0.1, 10, 0.1},{a, 0.1, 3, 0.1}, {c, 10, 20, 1}]

Now all I want is something rather humble. I noticed when playing around with my manipulate plot that sometimes I had values vanish outside of the plot. So I decided to use the "PlotRange ->{}" command.

what I wanted to do is that for every a and c the programm would run the list plot and determine one maximum value of V (for the y axis)

 PlotRange ->{x-value, Max[[Table[funct1[a, b, c][[8,2]], {b, 0.01,temp, 0.1}]]}

which works! But using a whole Max[Table...] just for one y-coordinate seems rather excessive to me. There surely must be another way. For clarity I will now show the code in total so people see what I mean:

    Manipulate[ListPlot[Table[funct[a, b, c][[8]], {b, 0.01,temp, 0.1}],
       PlotRange -> {{0, 1}, {0, Max[Table[funct[a, b, c][[8,2]],
 {b, 0.01,temp,0.1}]]}}, Joined -> True],{temp, 10, 0.1}, {a, 0.1,3, 0.1}, {c, 10, 20, 1}]

So just to be clear this function works! The problem is that I need alot of work to determine just the y-coordinate for the plotrange. Can I maybe take the Max[Table[funct[a, b, c][[8,2]],{b, 0.01,temp,0.1}]]} part define it somewhere else as a function and the just insert this simplified version into the plotrange?

Thanks in advance, you guys are awesome ! (:

$\endgroup$
  • $\begingroup$ Does PlotRange -> All do what you want? (Sry. Only have a phone right now.) $\endgroup$ – Michael E2 Jan 11 at 14:44

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.