Mathematica Asked by charmin on October 24, 2020
I use DiscretePlot for a function $f$ and the result is
As I see, the range of the function includes negative values. Then, when I use ScalingFunctions -> "Log", I obtain
Here, the negative range of the function is given by positive values. Is this true?
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]
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}]
Answered by user64494 on October 24, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP