1
votes

I am a beginner in Mathematica, I want to plot this log((x + y)/y). I did some attempts such as below but it kept showing an error as below. Would you please tell me what is wrong in the syntax?

LogLogPlot[{log[(x + y)/y]}, {x, 0.1, 3}, {y, 0.1, 3}]

LogLogPlot::nonopt: Options expected (instead of {y,0.1,3}) beyond position 2 in LogLogPlot[{log[(x+y)/y]},{x,0.1,3},{y,0.1,3}]. An option must be a rule or a list of rules.

2
Do you want a 3D LogPlot? Then this might help you. At least the Mathematica versions I know do not have a 3D LogLogPlot build in. - mikuszefski
as a note, if the function name does not contain 3D or Contour or Density, but just Plot like ListPlot etc, it is most likely only for 2D - mikuszefski

2 Answers

0
votes

Referencing this question and answer.

pl = Normal@ContourPlot[Log[(x + y)/y],
     {x, 0.1, 3}, {y, 0.1, 3}, PlotPoints -> 100];

ListLogLogPlot[Cases[pl, Line[a_, b___] :> a, Infinity],
 Joined -> True, Frame -> True, PlotRange -> All,
 AspectRatio -> 1, PlotStyle -> ColorData[1][1]]

enter image description here

0
votes

You may use Plot3D with the ScalingFunctions option.

Plot3D[Log[(x + y)/y], {x, 0.1, 3}, {y, 0.1, 3},
 ScalingFunctions -> {None, None, "Log"},
 MeshFunctions -> {#3 &},
 BoxRatios -> Automatic]

Mathematica graphics

Click and drag the plot to rotate. Also note that in the Wolfram Language is case sensitive so it is Log and not log.

Hope this helps.