TransWikia.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!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP