mentioned function works
> without problems; with the answer being as much meaningful as
> the test being the
> equivalence predicate (well, sometimes it is just what one
> needs). My examples
> were run using version 3.0, in which the implementation of
> Intersection[..., SameTest->test] is buggy.
Konstantin.
>
operational semantics of Intersection (as implemented in Mathematica)
>
...
> It is not clear from the manual (book or help browser), what this
command
> > is supposed to return.
> >
...
> What idea stands behind this function? what is it supposed to do?
> >
As to my observation
Intersection[a, b, SameTest -> tst]
is just the same as
Select[Sort[a],
Function[s1, Or @@ Function[s2, tst[s1, s2]] /@ b ]]
except for possible side effects when applying tst.
(*
You also may account for that if you wish, using proper Catch-Throw
constructs:
compare
Select[Sort[a], Function[s1,
Catch[Scan[
Function[s2, If[(Print[s1, ~, s2]; s1 == 2 s2), Throw[True]]],
b]]
]]
with
Intersection[a, b, SameTest ->((Print[#1,~,#2];#1==2 #2)&)]
*)
Given
a = {1, 6, 0, 0, 8};
b = {3, 8, 0, 0};
In[15]:= Intersection[a, b, SameTest -> (True &)]
Out[15]= {0, 0, 1, 6, 8}
In[23]:= Intersection[a, {}, SameTest -> (True &)]
Out[23]= {}
In[35]:= Intersection[a, b, SameTest -> (#1 == 2*#2 &)]
Out[35]= {0, 0, 6}
In[168]:= Intersection[a, b, SameTest -> (#1 == #2&)]
Out[168]= {0, 0, 8}
but:
In[170]:= Intersection[a, b]
Out[170]= {0, 8}
(This is to model set intersection, but with any test function unifying
would be too restrictive.)
In[148]:= Select[Sort[a], Or @@ Function[e, True] /@ b &]
Out[148]= {0, 0, 1, 6, 8}
In[149]:= Select[Sort[a], Or @@ Function[e, True] /@ {} &]
Out[149]= {}
In[105]:= Select[Sort[a], Or @@ Function[e, # == 2 e] /@ b &]
Out[105]= {0, 0, 6}
In[169]:= Select[Sort[a], Or @@ Function[e, # == e] /@ b &]
Out[169]= {0, 0, 8}
This is what the function does. For what you use it, is quite a different
matter. This also applies to the logical primitives (and we know how to
deal
with that), viz.:
In[95]:= (True || Print[hello])
Out[95]= True
In[97]:= (False || Print[hello]) // InputForm
Out[97]//InputForm= Null
Short cut evaluation and passing non-logical expressions makes this
resemble
an If-expression.
The lists a and b need not be of the same type, see e.g.
In[157]:=
isColor[hue_, red] := hue < 1/6 || hue > 5/6;
isColor[hue_, green] := 1/6 <= hue < 1/2;
isColor[hue_, blue] := 1/2 <= hue < 7/6
In[154]:= hh = Table[Random[Real], {10}]
Out[154]=
{0.599664, 0.131625, 0.377189, 0.410453, 0.502879,
0.588352, 0.601769, 0.554794, 0.801087, 0.767142}
In[161]:=
Intersection[hh, {red, blue}, SameTest -> isColor]
Out[161]=
{0.131625, 0.502879, 0.554794, 0.588352,
0.599664, 0.601769, 0.767142, 0.801087}
In[162]:=
Intersection[hh, {green}, SameTest -> isColor]
Out[162]=
{0.377189, 0.410453}
On the other hand, to make the SameTest function be an equivalence
function,
is just not enough for intuitive expectation. See
In[8]:= x_~r~y_ := MatchQ[y/x, _Rational | _Integer]
In[12]:=
Table[Sqrt[Random[Integer, {1, 5}]]Random[Integer, {1, 10}], {100}]
Out[12]=
!({3 @3, 4 @2, 5, 5, 3 @5, 8, 8 @5, 5 @3, 5, 14, 5
@5, 8,
7 @2, 8 @3, 4 @5, 10, 12, 1, 12, 5 @2, 9 @5, 5
@5, 2 @3,
4,
5 @5, 10, 9 @3, 14, 14, 9 @3, 9, 5 @2, 8, 4 @2, 18,
@5,
9 @5, @3, 3 @2, 8, 5, 8 @2, 7 @5, 9 @2, 6, 10
@3, 10,
9 @3, 10 @3, 5 @3, 3, 3 @5, 4, 12, 18, 12, 8 @2, 8,
9 @2,
18,
10 @5, 4 @5, 16, 4 @2, 5 @5, 1, 5 @3, 2 @3,
@3, 5 @2,
7 @2, @2, 2 @2, 3, 5 @3, @2, 3 @2, 5 @5, 8
@3, 5 @3,
4 @2, 4, 9 @3, 10 @2, 5 @3, 3 @5, 6 @3, 10
@3, 9 @3, 7,
5 @5, 4 @3, 3, 7, 2, 2, 5, 14, 7 @2, 16})
(* I did not convert this to InputForm, read @3 as Sqrt[3], 4 @2
as
4*Sqrt[2] *)
In[13]:= Union[%, SameTest -> r]
Out[13]= !({1, @2, @3, @5})
The equivalence classes.
In[14]:= a = 3*{Sqrt[3], Sqrt[5]}
Out[14]= !({3 @3, 3 @5})
In[15]:=
b = Table[Sqrt[Random[Integer, {1, 5}]]Random[Integer, {1, 10}], {10}]
Out[15]=
!({6, 5 @5, @3, @3, 5 @3, 9 @5, 4 @5, 7, 3, 2
@3})
In[16]:= Intersection[a, b]
Out[16]= {}
In[17]:= Intersection[a, b, SameTest -> r]
Out[17]= !({3 @3, 3 @5})
Although the elements of a do not occur in b, each meets another member of
its equivalence class, and such is part of the result. The representatives
are not normalized though.
In[18]:= bb = Union[b, b, SameTest -> r]
Out[18]= !({3, @3, 4 @5})
In[19]:= Intersection[a, bb, SameTest -> r]
Out[19]= !({3 @3, 3 @5})
Same result as above, since we still have the same classes.
In[20]:= Intersection[b, b, SameTest -> r]
Out[20]=
!({3, 6, 7, @3, @3, 2 @3, 5 @3, 4 @5, 5 @5, 9
@5})
Obviously, the SameTest doesn't change anything here.
The Mathematica function Intersection clearly is not symmetric:
In[21]:= Intersection[bb, b, SameTest -> r]
Out[21]=
!({3, @3, 4 @5})
In[22]:= Intersection[b, bb, SameTest -> r]
Out[22]=
!({3, 6, 7, @3, @3, 2 @3, 5 @3, 4 @5, 5 @5, 9
@5})
To conclude: the SameTest function for Intersection is of only limited help
implementing set operations on equivalence classes. One at least should
unify the first argument to Intersection, or better reduce each expression
to normal form and then use normal set operations (without SameTest).
The meaning of Intersection with SameTest is given by its operational
semantics. It is an asymmetrical operation, and there is no need for
SameTest to be symmetric, reflexive or transitive. Just consider it as an
idiom for a special - and useful - Select operation.
--
Hartmut Wolf
====
> -----Original Message-----
> Sent: Tuesday, March 05, 2002 9:09 AM
> To: mathgroup@smc.vnet.net
> Given a list like this :
>
> lst = {a, b, c*t, r*s, 2*t, 3, 0};
I would like build a rule (c -> c t) for each elements c of the list
> that are not function of t that give like solution :
Out[] := {a t, b t, c t, r s t, 2 t, 3 t, 0}
I have tested the following way but they are not work
lst /. (c_ /; FreeQ[c, t]) -> c*t
and
integrate[c_, t_] := c t /; FreeQ[c, t]
> lst /. c_ -> integrate[c, t]
I will appreciate your held
Guillermo Sanchez
>
Guillermo,
In[3]:=
Replace[lst,c_ [RuleDelayed] c t /;FreeQ[c,t],{1}]
Out[3]=
{a t,b t,c t,r s t,2 t,3 t,0}
Replace[lst, rule, {1}] restricts replacement to the elements of lst (at
level 1). ReplaceAll definitely does too much.
--
Hartmut
====
>Given a list like this :
>
>lst = {a, b, c*t, r*s, 2*t, 3, 0};
I would like build a rule (c -> c t) for each elements c of the list
>that are not function of t that give like solution :
Out[] := {a t, b t, c t, r s t, 2 t, 3 t, 0}
I have tested the following way but they are not work
lst /. (c_ /; FreeQ[c, t]) -> c*t
and
integrate[c_, t_] := c t /; FreeQ[c, t]
>lst /. c_ -> integrate[c, t]
>
lst={a,b,c*t,r*s,2*t,3,0};
lst /. c_?(FreeQ[#,t,1]&) -> c*t /. t^2->t
{a*t, b*t, c*t, r*s*t, 2*t, 3*t, 0}
or
lst*t /. t^2->t
{a*t, b*t, c*t, r*s*t, 2*t, 3*t, 0}
Bob Hanlon
Chantilly, VA USA
====
Guillermo,
Since you want to operate on each level 1 element in the list, and not on
each element in the expression, why not do something more direct?
lst = {a, b, c*t, r*s, 2*t, 3, 0};
If[FreeQ[#, c], # t, #] & /@ lst
{a*t, b*t, c*t, r*s*t, 2*t^2, 3*t, 0}
David Park
djmp@earthlink.net
http://home.earthlink.net/~djmp/
> Given a list like this :
lst = {a, b, c*t, r*s, 2*t, 3, 0};
I would like build a rule (c -> c t) for each elements c of the list
> that are not function of t that give like solution :
Out[] := {a t, b t, c t, r s t, 2 t, 3 t, 0}
I have tested the following way but they are not work
lst /. (c_ /; FreeQ[c, t]) -> c*t
and
integrate[c_, t_] := c t /; FreeQ[c, t]
> lst /. c_ -> integrate[c, t]
I will appreciate your held
Guillermo Sanchez
>
====
Some possibilities:
In[1]:=
lst = {a, b, c*t, r*s, 2*t, 3, 0}
Out[1]=
{a,b,c t,r s,2 t,3,0}
In[2]:=
(# /. x_ :> If[FreeQ[x, t], t*x, x] & ) /@ lst
Out[2]=
{a t,b t,c t,r s t,2 t,3 t,0}
In[3]:=
(If[FreeQ[#, t], t*#, #] & ) /@ lst
Out[3]=
{a t,b t,c t,r s t,2 t,3 t,0}
In[4]:=
Cases[lst, x_ :> If[FreeQ[x, t], t*x, x]]
Out[4]=
{a t,b t,c t,r s t,2 t,3 t,0}
Tomas Garza
Mexico City
----- Original Message -----
I have tested the following way but they are not work
lst /. (c_ /; FreeQ[c, t]) -> c*t
and
integrate[c_, t_] := c t /; FreeQ[c, t]
> lst /. c_ -> integrate[c, t]
I will appreciate your held
Guillermo Sanchez
>
====
I would like to use my Windows computer as an instrument and collect sound
data under the control of Mathematica. How do I get it to switch on the
sound recorder, record for a given length of time and then switch off?
Mathematica can then import the file, analyse the data and wait until a
later time when it can repeat the whole operation again.
I can do all of this by using Sound Recorder from the Input menu but I have
to click the buttons. Can I get it to work automatically, and unsupervised,
by using FrontEndTokens or is there a better method?
Hugh Goyder
====
write a MathLink program that access the sound/ microphon
driver of your operating system.
Jens
I would like to use my Windows computer as an instrument and collect
sound
> data under the control of Mathematica. How do I get it to switch on the
> sound recorder, record for a given length of time and then switch off?
> Mathematica can then import the file, analyse the data and wait until a
> later time when it can repeat the whole operation again.
> I can do all of this by using Sound Recorder from the Input menu but I
have
> to click the buttons. Can I get it to work automatically, and
unsupervised,
> by using FrontEndTokens or is there a better method?
Hugh Goyder
====
> you can launch the frontend as MathLink child from the kernel.
lnk = LinkLaunch[C:Program FilesWolfram
> ResearchMathematica4.0Mathematica.exe -mathlink]
> < HTMLSave[index.html,source.nb]
> ]
Jens
[...]
when do it like this, I still get the following error message:
FrontEndObject::notavail:
A front end is not available; certain operations require a front end.
Using the LinkLaunch command, math starts the mathematica front end and
I can use FrontEndExecute for executing commands which are only using
the front end, but it seems, that I still don't have a connection
between the kernel and the front end.
Yours,
Alexander
--
/ Alexander Dreyer, Dipl.-Math. - Abteilung Adaptive Systeme
/ Fraunhofer Institut fuer Techno- und Wirtschaftsmathematik (ITWM)
Gottlieb-Daimler-Strasse, Geb. 7^2=49/302 D-67663 Kaiserslautern /
http://www.itwm.fhg.de Tel.:(0631)205-4472 Fax:(0631)205-4139 /
====
> you can launch the frontend as MathLink child from the kernel.
lnk = LinkLaunch[C:Program FilesWolfram
> ResearchMathematica4.0Mathematica.exe -mathlink]
> < HTMLSave[index.html,source.nb]
> ]
Jens
ok, I found my problem, the variable $Notebooks has to be set to True
HTMLSave.
Alexander
--
/ Alexander Dreyer, Dipl.-Math. - Abteilung Adaptive Systeme
/ Fraunhofer Institut fuer Techno- und Wirtschaftsmathematik (ITWM)
Gottlieb-Daimler-Strasse, Geb. 7^2=49/302 D-67663 Kaiserslautern /
http://www.itwm.fhg.de Tel.:(0631)205-4472 Fax:(0631)205-4139 /
====
I was recently working with some trig functions. More specifically
for quantum mechanics where one often has terms like Sin[n Pi]. I
noticed what seemed a bug in Mathematica's Simplify[,Assumptions].
In[1]:=
Simplify[Sin[n*Pi]/n, Element[n,Integers]]
Out[1]=
0
Which is fine as long as n is not zero.
In[2]:=
Limit[Sin[n*Pi]/n, n -> 0]
Out[2]=
Pi
It appears to me that Simplify is correctly determining that Sin[n
Pi]=0 for n an integer, but it ignores the fact that there is an
indeterminate 0/0. I realize that this is a special case, but it
seems to occur often enough that it should be handled properly or at
least provide a warning message that one should double check the
results.
Am I being picky or do others feel the same?
Adam Smith
====
> I was recently working with some trig functions. More specifically
> for quantum mechanics where one often has terms like Sin[n Pi]. I
> noticed what seemed a bug in Mathematica's Simplify[,Assumptions].
In[1]:=
> Simplify[Sin[n*Pi]/n, Element[n,Integers]]
Out[1]=
> 0
This is certainly not a bug. Note that 0/x simplifies to 0, period.
Of course, you might well argue that, when simplifying 0/x to 0, some
indication should be provided that that result is not valid if x = 0.
Are there computer algebra systems which standardly
provide such qualifications? Is it possible to specifically request
Mathematica to provide such qualifications? I don't know the answers to
these two questions. But stating fully the qualifications required for
all simplifications in a messy computation could easily overwhelm the
ordinary user. You might take a look at Crimes and Misdemeanors in
the Computer Algebra Trade, David R. Stoutemyer, _Notices of the
American Mathematical Society_ 38:7 (1991) 778-785. Does anyone have
references to similar discussions by other authors? If so, I'd be quite
interested in reading them.
> Which is fine as long as n is not zero.
In[2]:=
> Limit[Sin[n*Pi]/n, n -> 0]
Out[2]=
> Pi
It appears to me that Simplify is correctly determining that Sin[n
> Pi]=0 for n an integer, but it ignores the fact that there is an
> indeterminate 0/0. I realize that this is a special case, but it
> seems to occur often enough that it should be handled properly
I'm not entirely sure what you think handled properly would be.
For me, in a system in which 0/0 is undefined,
Simplify[Sin[n*Pi]/n, Element[n,Integers]] should yield
0 if n is nonzero, undefined if n is 0.
> or at least provide a warning message that one should double check
> the results.
Am I being picky or do others feel the same?
You're not being picky, at least IMO. But perhaps what you would like
is not practical.
David Cantrell
--
-------------------- http://NewsReader.Com/ --------------------
====
Okke,
I have assumed that you want to be able to overide the defaults for xPlot.
I have also allowed for the different syntaxes possible for the value of
PlotStyle and for several expressions being plotted at the same time.
Options[xPlot] = {PlotStyle ->
{{Thickness[0.02], Hue[0]}}};
xPlot[expr_, range_, (opts___)?OptionQ] :=
Module[{pst, def, new},
pst = PlotStyle /. {opts} /. PlotStyle -> {{}};
def = PlotStyle /. Options[xPlot];
new = pst /. {{x___} :> (Flatten[{def, #1}] & ) /@
{x}, x_ :> {Flatten[{def, x}]}};
Plot[expr, range, PlotStyle -> new, opts]]
xPlot[x, {x, 0, 1}];
xPlot[x, {x, 0, 1}, PlotStyle -> {Hue[0.4]}];
The default can be modified independently for each of several expressions
xPlot[{x, x^2}, {x, 0, 1}];
xPlot[{x, x^2}, {x, 0, 1}, PlotStyle ->
{Hue[0.4], Thickness[0.01]}];
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay@haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
I want to create a function with an option to set the plot color.
> After looking at the examples I was cabable of making a function
> in which I could add an option, but I couldnt merge the additional
> option with the used option inside the function.
could somebody please help me and tell me how I can make the function
> and function call below work?
tia,
> xPlot[function_, range_] :=
> Plot[function, range,PlotStyle -> {Thickness[0.02]}]
xPlot[Sin[n], {n, 0, 2 Pi}, PlotStyle -> {RGBColor[0, 1, 0]}]
> --
> Okke
====
Using Mathematica 4.1, under Mac OS X, is it possible to create pdf files
simply by using the Preview feature with all Math fonts embedded? I post
pdf
files on the web for my students and can't count on them having the Math
fonts.
I am long time Mathematica user and have struggled with Distiller and Math
font problems. At the moment I do not have the MacOSX version of the
Distiller. I would like to avoid purchasing it if possible. The pdf files
using the Preview look fine on my computer. However when I look at them on
a
different computer some characters are messed up.
====
I have the following problem: An experimental set of points, which have
each three coordinates Y,x1 and x2 and I did with the Fit or Regress
functions the fit of the points succesfully. Now I want to plot the
function and the points. The fitting function was plotted with the
Plot3D but I could'n figure out how to plot the set points. ListPlot3D
gave an error message that the point could have only two coordinate.
====
increment of a variable which I'd like to represent on the graph. About all
I've been able to do so far is to rig up the list so that each entry in the
array/list being plotted represents some integer multiple of the actual
variable so things don't get
too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd like it to go
from say, 0 to 600 (MHz). Surely this is easily done but I haven't found a
single example of this in the books or in reviewing the posts on this ng.
Options[ListPlot] doesn't help me either.
This is no problem when using Plot[] on a continuous variable.
Rob
====
x = Table[Sin[z], {z, 0, 3.0, 0.01}];
with
ListPlot[MapIndexed[{2*First[#2], #1} & , x]]
ranges from {2,600}
But you may calculate the independent values in your Table[]
x = Table[{200*z,Sin[z]}, {z, 0, 3.0, 0.01}];
ListPlot[x]
Jens
increment of a variable which I'd like to represent on the graph. About
all I've been able to do so far is to rig up the list so that each entry in
the array/list being plotted represents some integer multiple of the actual
variable so things don't get
> too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
> ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd like it to
go from say, 0 to 600 (MHz). Surely this is easily done but I haven't found
a single example of this in the books or in reviewing the posts on this ng.
Options[ListPlot] doesn't help me either.
This is no problem when using Plot[] on a continuous variable.
> Rob
====
> -----Original Message-----
> Sent: Tuesday, March 05, 2002 9:09 AM
> To: mathgroup@smc.vnet.net
> only after a long time of putting up with no solution. I
> have a list which I plot but the integer x axis of the plot
> is not scaled to suit me. Each position in the list results from some
> increment of a variable which I'd like to represent on the
> graph. About all I've been able to do so far is to rig up
> the list so that each entry in the array/list being plotted
> represents some integer multiple of the actual variable so
> things don't get
> too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
> ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd
> like it to go from say, 0 to 600 (MHz). Surely this is
> easily done but I haven't found a single example of this in
> the books or in reviewing the posts on this ng.
Options[ListPlot] doesn't help me either.
This is no problem when using Plot[] on a continuous variable.
> Rob
Rob,
do
In[37]:= Subscript[t, 0] = Pi/600.
In[38]:=
x = Table[{[Omega], Sin[[Omega]*Subscript[t, 0]]}, {[Omega], 0, 600,
2}];
In[39]:= ListPlot[x]
However for this, I'd prefer to take less samples and use option PlotJoined
-> True. Depends on your application.
--
Hartmut
====
>I have a list which I plot but the integer x axis of the plot is not
scaled
>to suit me. Each position in the list results from some
>increment of a variable which I'd like to represent on the graph. About
>all I've been able to do so far is to rig up the list so that each entry
>in the array/list being plotted represents some integer multiple of the
>actual variable so things don't get
>too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
>ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd like it to
>go from say, 0 to 600 (MHz). Surely this is easily done but I haven't
>found a single example of this in the books or in reviewing the posts on
>this ng.
Options[ListPlot] doesn't help me either.
This is no problem when using Plot[] on a continuous variable.
>
data=Table[{200z,Sin[z]},{z,0,3.0,0.01}];
ListPlot[data];
Bob Hanlon
Chantilly, VA USA
====
Rob,
You didn't say how your got your original list.
x = Table[Sin[z], {z, 0, 3.0, 0.01}];
(One of the problems with ListPlot using this kind of array is that the
x-axis goes from 1 to the length of the list. You would probably prefer
that
it start at zero.)
If you generated your list the following way, you would get the x-scale you
desired.
xx = Table[{z, Sin[z/200]}, {z, 0, 600.0, 2}];
ListPlot[xx];
You could create a similar list from the original list by
x2 = Transpose[Join[{2Range[0, Length[x] - 1]}, {x}]];
ListPlot[x2];
Or you could generate your own tick labels this way.
ListPlot[x,
Ticks -> {Table[{i, 2(i - 1)}, {i, 1, 301, 50}], Automatic}];
But it is more work to get the minor, unlabeled, ticks.
Or, if you have my DrawGraphics package from my web site, you can use
CustomTicks to conveniently obtain any tick scale that you want. It would
be
done this way.
Needs[DrawGraphics`DrawingMaster`]
Draw2D[
{ListDraw[x]},
Axes -> True,
Ticks -> {CustomTicks[#/2 + 1 &, {0, 600, 100, 5}], Automatic}];
This says that we want ticks going from 0 to 600 in steps of 100 with 5
subdivisions. The pure function tells how to go from the labeled values to
the actual plot coordinate (which went from 1 to 301).
David Park
djmp@earthlink.net
http://home.earthlink.net/~djmp/
after a long time of putting up with no solution. I have a list
> which I plot but the integer x axis of the plot is not scaled to
> suit me. Each position in the list results from some
> increment of a variable which I'd like to represent on the graph.
> About all I've been able to do so far is to rig up the list so
> that each entry in the array/list being plotted represents some
> integer multiple of the actual variable so things don't get
> too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
> ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd
> like it to go from say, 0 to 600 (MHz). Surely this is easily
> done but I haven't found a single example of this in the books or
> in reviewing the posts on this ng.
Options[ListPlot] doesn't help me either.
This is no problem when using Plot[] on a continuous variable.
====
> only after a long time of putting up with no solution. I
> have a list which I plot but the integer x axis of the plot
> is not scaled to suit me. Each position in the list results from some
> increment of a variable which I'd like to represent on the
> graph. About all I've been able to do so far is to rig up
> the list so that each entry in the array/list being plotted
> represents some integer multiple of the actual variable so
> things don't get
> too confusing. For example:
x=Table[Sin[z],{z, 3.0, 0.01}];
> ListPlot[x]
The plot looks nice but the x axis goes from 0 to 300 and I'd
> like it to go from say, 0 to 600 (MHz). Surely this is
> easily done but I haven't found a single example of this in
> the books or in reviewing the posts on this ng.
The first problem is your list; x contains values of Sin[z] ranging from
3.0
to 0.01 in steps of 1 ie, your list contains nothing.
Assuming you want
x = Table[Sin[z], {z, 0, 3.0, .01}];,
you can control the range via PlotRange, an option to ListPlot.
For example,
ListPlot[x, PlotRange -> {{0, 600}, All}];
ListPlot[x, PlotRange -> {{0, 600}, {-1, 1}}];
> Options[ListPlot] doesn't help me either.
In[31]:=
Options[ListPlot]
Out[31]=
!({AspectRatio [Rule] 1/GoldenRatio, Axes [Rule] False,
AxesLabel [Rule] None, AxesOrigin [Rule] Automatic,
AxesStyle [Rule] Automatic, Background [Rule] Automatic,
ColorOutput [Rule] Automatic, DefaultColor [Rule] Automatic,
Epilog [Rule] {}, Frame [Rule] True, FrameLabel [Rule] None,
FrameStyle [Rule] Automatic, FrameTicks [Rule] Automatic,
PlotJoined [Rule] True, PlotLabel [Rule] None, PlotRange [Rule]
All,
PlotRegion [Rule] Automatic, PlotStyle [Rule] Automatic,
Prolog [Rule] {}, RotateLabel [Rule] True, Ticks [Rule] Automatic,
DefaultFont [RuleDelayed] $DefaultFont,
DisplayFunction [RuleDelayed] $DisplayFunction,
FormatType [RuleDelayed] $FormatType,
TextStyle [RuleDelayed] $TextStyle})
PlotRange is right there between PlotLabel & PlotRegion ....
Dave.
--------------------------------------------------------
Dr. David Annetts EM Modelling Analyst
Tel: (+612) 9490 5416 CSIRO DEM, North Ryde
Fax: (+612) 9490 5467 David.Annetts@csiro.au
Include usual_disclaimers
--------------------------------------------------------
====
Could someone please explain what the Inherited symbol is and what it does?
(It's often seen in the CellMargins option for Cell.) I can't find any
information in Help, The Book, or the Mathematica website.
Ken Morgan
====
it means the same as in a OOP language, get the value form the
parent, i.e., if the parent cell has the value of the option
set, the daugther cell use this value too
Jens
Could someone please explain what the Inherited symbol is and what it
does?
> (It's often seen in the CellMargins option for Cell.) I can't find any
> information in Help, The Book, or the Mathematica website.
Ken Morgan
====
> Could someone please explain what the Inherited symbol is and what it
does?
> (It's often seen in the CellMargins option for Cell.) I can't find any
> information in Help, The Book, or the Mathematica website.
The Inherited symbol conveys that a front end option at a given scope
should be inherited from the closest broader scope that has this option
setting specified explicitly.
See Section 2.10.8 of _The Mathematica Book_ (Fourth Edition) for a
brief discussion of option value inheritance.
I've also posted additional material to this forum.
http://library.wolfram.com/mathgroup/archive/1998/Apr/msg00130.html
--
User Interface Programmer paulh@wolfram.com
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.
> following systems,