Message Boards Message Boards

2
|
112131 Views
|
12 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How to change Y axis range

Posted 11 years ago
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
POSTED BY: John G
12 Replies
Yahia, The PlotRange produces the correct result. Do you just want to change ticks?
POSTED BY: Shenghui Yang
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]

POSTED BY: Shenghui Yang
Posted 11 years ago
Hi, Mr.Yang,

Yes, I need to change it like the below graph of Y axis scale...Thanks a lot for your cooperation 

POSTED BY: John G
Posted 11 years ago
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

POSTED BY: John G
so you want to plot the scattered data and the smooth curver together? 
POSTED BY: Shenghui Yang
Posted 11 years ago
Yes, the scattered data (by simulation) vs smooth curve in the same graph. Thanks
POSTED BY: John G
Then you just need Show and ListLogPlot to complete this task in addition to your plot result p: 
Show[ListLogPlot[<dataList>],LogPlot[func,range]]
POSTED BY: Shenghui Yang
Posted 11 years ago
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
POSTED BY: John G
Did you repace <DataList> with the actual data you have? You can put some numbers (~10) here for test
POSTED BY: Shenghui Yang
Posted 11 years ago
Is it possible to use RandomVariate for (S) for choosing random values?
POSTED BY: John G
For which "S"? the global one, yes. Not Ok for the localized one in Plot. 
POSTED BY: Shenghui Yang
Posted 11 years ago
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? 

POSTED BY: John G
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract