I'm here with a rather interesting problem which I have no clue how to fix.
I am trying to plot a function:
Plot[x && 0 <= x <= (1/8), {x,-9,9}]
However the graph does not seem to appear at all.
The interesting thing though is if I change $\frac{1}{8}$ to $\frac{185}{1000}$ the plot works normally. Change it to $\frac{184}{1000}$ and it stops working again. So why does nothing plot where the second value is below $\frac{184}{1000}$?
Regarding to why I don't use the {x,-9,9} to set the domain. I am plotting other functions on the same graph and omitted them for this post. The error is still present when it is on its own.
Also if you were wondering. Here are some other things I did to troubleshoot the error to save some time. Firstly, changing the first value of 0 to $\frac{1}{100}$ retrieves the same problem and the second value can not go below $\frac{184}{1000}$ but can still go above $\frac{185}{1000}$ so it doesnt seem like the issues relates to the difference between the minimum and maximum. Changing the function to $2x$ doesnt change this either and has the same possible values. Same with $2x^2$ and $\sqrt{x}$. So from this I can see this problem occurs with every single type of function.
There is one parameter which changes this however. If we change {x,-9,9} to {x,-8,8} then $\frac{184}{1000}$ becomes possible. As a result of changing this the new possible values for the domain are $\frac{164}{1000}$ and above (instead of $\frac{185}{1000}$ and above). Anything lower and it doesnt work although I haven't gone to any larger denominators I'm sure its evident to see there is some issue here.
Also, if this is just purely a Mathematica error. Any alternatives to set a domain for an individual function without using Show[plot1,plot2 etc.] would be awesome. If it helps I am on Mathematica 9.0. Thanks
EDIT: Just clarifying here after a response. I wish for the final plot to still show from -9 to 9 because there are other functions being plotted on this graph and this is the domain I wish for the entire graph to go over.
PlotPoints
, sayPlotPoints->100
? $\endgroup$