How can I change the Y axis range from 10^-3 to 10^0 with step size: 10^-1 to plot the following function
f = Product[ 1 - (Gamma[m, (m (((10 Log10[3]) *0.5)/S )^(1/n))/t] Gamma[ m, (m ((10 Log10[3]*0.75)/S)^(1/n))/t])/Gamma[m]^2, {i, 1, M}] /. Subscript -> Part;
p = Plot[f, {S, 0, 20}, PlotRange -> {0,1}]
Assuming that: m =1.64, n=2, M = 3 , t=1.57
I used PlotRange but it does not work..
Thanks for your support
shenghuiy
(Shenghui Yang)
August 28, 2013, 8:27pm
2
Yahia, The PlotRange produces the correct result. Do you just want to change ticks?
Hi, Mr.Yang,
Yes, I need to change it like the below graph of Y axis scale…Thanks a lot for your cooperation
shenghuiy
(Shenghui Yang)
August 28, 2013, 8:47pm
4
These lines will give you the result:
ticks = {10^-4, 10^-3, 10^-2, 10^-1, 0};
p = LogPlot[f, {S, 0, 20}, PlotRange -> {10^-4, 1},
Ticks -> {Automatic, ticks}, GridLines -> Automatic, Frame -> True]
Mr.Yang,
You are right!!, I have already plot the graph as below. Actually, I have another question if possible. I need to know how to plot the graph in Analytical (theoretical) versus Simulation (Empirical) result as illustarated in my original graph above. In fact, in Matlab, there is a tool box with Monte-Carlo option but I would like to know how we can achieve it in Mathematica. However, I have posted a question on your Forum before called “How To Plot The Outage Probability (F)”, but I am still confused for the given answer!! and it’s not the right way. I appreciate your support. Thanks a lot
shenghuiy
(Shenghui Yang)
August 28, 2013, 9:37pm
6
so you want to plot the scattered data and the smooth curver together?
Yes, the scattered data (by simulation) vs smooth curve in the same graph. Thanks
shenghuiy
(Shenghui Yang)
August 28, 2013, 9:48pm
8
Then you just need Show and ListLogPlot to complete this task in addition to your plot result p:
Show[ListLogPlot[<dataList>],LogPlot[func,range]]
I have tried your command but it does not work, you can implement it with the given function: “dataList” is not recognized!!
f = Product[ 1 - (Gamma[m, (m (((10 Log10[3]) *0.5)/S )^(1/n))/t] Gamma[ m, (m ((10 Log10[3]*0.75)/S)^(1/n))/t])/Gamma[m]^2, {i, 1, M}] /. Subscript -> Part;
p = Plot[f, {S, 0, 20}, PlotRange -> {0,1}]
m =1.64, n=2, M = 3 , t=1.57
shenghuiy
(Shenghui Yang)
August 29, 2013, 1:18am
10
Did you repace <DataList> with the actual data you have? You can put some numbers (~10) here for test
Is it possible to use RandomVariate for (S) for choosing random values?
shenghuiy
(Shenghui Yang)
August 29, 2013, 6:11pm
12
For which “S”? the global one, yes. Not Ok for the localized one in Plot.
The graph has been plotted but I used Table option as follows:
data2 = Table[{S, f}, {S, 0, 40}]
G2 = ListLogPlot[data2, PlotRange -> {10^-4, 1}, Ticks -> {Automatic, ticks}, GridLines -> Automatic, Frame -> True]
I think it’s wrong way, but what about your openion?