1
$\begingroup$

This question already has an answer here:

If you use Plot like this,

Plot[Sin[x], {x, 1, 5}]

it produces the correct Sin graph with x from 1 to 5. Something that also works is to give the xmin and xmax values as a sequence like this,

Plot[Sin[x], {x, Sequence[1, 5]}]

However when I try to do the same thing for LogPlot (or indeed LogLinearPlot or LogLogPlot),

LogPlot[Sin[x], {x, Sequence[1, 5]}]

it outputs this (I don't believe this is even an error message):

Graphics`LogPlotDump`scaledPlot[]

How do you get LogPlot to accept a sequence for its limits?

$\endgroup$

marked as duplicate by Kuba, Community Aug 11 '16 at 13:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ closely related: Injecting a sequence of expressions into a held expression $\endgroup$ – Kuba Aug 11 '16 at 12:23
  • $\begingroup$ Can you describe what is the use case? I mean, I suppose you are not typing "Sequence" by hand, \right? $\endgroup$ – Kuba Aug 11 '16 at 12:24
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Aug 11 '16 at 13:07
2
$\begingroup$

The same way it should be done for regular plot:

LogPlot[Sin[x], {x, Sequence[1, 5]} // Evaluate]

Or if x has potentially been defined as a global value elsewhere

Block[{x}, LogPlot[Sin[x], {x, Sequence[1, 5]} // Evaluate]]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.