AnswerBun.com

Is the range of this plot correct using *ScalingFunctions -> "Log"*?

Mathematica Asked by charmin on October 24, 2020

I use DiscretePlot for a function $f$ and the result is

enter image description here

As I see, the range of the function includes negative values. Then, when I use ScalingFunctions -> "Log", I obtain

enter image description here

Here, the negative range of the function is given by positive values. Is this true?

One Answer

If I correctly understand it, you want to build a log-plot of a fuction taking negative values. In this case the ScalingFunctions -> "Log" option does not do the job. This can be done as follows. Compare

DiscretePlot[(-1)^n*n!, {n, 2, 7}, PlotRange -> All]

enter image description here

with

DiscretePlot[Piecewise[{{Log[Max[(-1)^n*n!, 0]], (-1)^n*n! >= 
 0}, {-Log[-Min[(-1)^n*n!, 0]], (-1)^n*n! < 0}}], {n, 2, 7}]

enter image description here

Answered by user64494 on October 24, 2020

Add your own answers!

Related Questions

Possible bug in RegionDistance with RegionBoundary?

1  Asked on June 27, 2021 by sneezefor16min

   

3D FEM Meshing Internal Regions

1  Asked on June 27, 2021 by andrew-green

   

Custom arrowhead will not align properly

0  Asked on June 26, 2021 by bjoj

   

Mathematica returns incorrect evaluation of integral

1  Asked on June 26, 2021 by comptonscattering

   

ExternalEvaluate Error

0  Asked on June 26, 2021

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir