19

ColorFunction and Epilog were around in version 7. However, ColorFunction did get an update in version 9 so I am not certain if this will work in version 7. Animate[ ParametricPlot[circle[t], {t, Max[0, u - .2], u}, PlotRange -> {{-dMax, dMax}, {-dMax, dMax}}, ColorFunction -> Function[{x, y, w}, Opacity[w, Blue]], Frame -> True, Axes ->...


18

The trick is to place some random non-overlapping Disks in your square area, then use the DistanceTransform to find a point in your square area that is the farthest from its nearest disk. (Such a point will be equidistant from at least two disks--generally three or more disks.) Place a new disk centered at this point, with its radius equal to the distance ...


16

You could do this: GatherBy[list, Last][[All, 1]] ~SortBy~ Last (* {{d, 3}, {b, 3.04}, {a, 3.1}} *)


16

Update: I just noticed you wrote Mathematica 7 and CirclePoints was introduced in v10.1. I am updating my code to eliminate it. I think what remains should work in v7; tell me if it does not. This may need some tuning but it should give you a good start: segment = Disk[#/2, 1/3] & /@ {{2, 0}, {1, Sqrt[3]}, {-1, Sqrt[3]}, {-2, 0}}; layer = Translate[...


14

This solution should work normally on Mathematica 7. It first generates a hexagonal grid and then removes every third point. Finally two grids are combined in one figure. I have fine-tuned the parameters to reproduce your figure. range = Range[1197]; x = Mod[range, 31 + 1/2] 2/Sqrt[3.]; y = Quotient[range, 31 + 1/2] ; allMeshPoints = Drop[Transpose[{x, y}]...


13

You can also define f conditionally: f[x_] := x^2 /; (-5 < x < -1 || 1 < x < 5)


12

With reg = ImplicitRegion[-5 < x < -1 || 1 < x < 5, x] or reg = Interval[{-5, -1}, {1, 5}] do Plot[x^2, {x} ∈ reg] EDIT This might work for v7: Plot[If[-5 < x < -1 || 1 < x < 5, x^2], {x, -5, 5}]


11

You don't := constant colors. Color1 = RGBColor[0.99, 0.2, 0.2, 0.5]; This space curve for example: curve = KnotData["Trefoil", "SpaceCurve"] (* {Sin[#1] + 2 Sin[2 #1], Cos[#1] - 2 Cos[2 #1], -Sin[3 #1]} & *) ParametricPlot3D[curve[t], {t, 0, 2 Pi}, PlotStyle -> AbsoluteThickness[10], ColorFunction -> (CurveColor[#4] &), ...


11

In V8 and up, one can use ConditionalExpression: Plot[ConditionalExpression[x^2, -5 < x < -1 || 1 < x < 5], {x, -5, 5}] Response to updated question This might work in all versions of Mathematica: Show[ Plot[x^2, {x, -5, -1}], Plot[x^2, {x, 1, 5}], PlotRange -> All]


11

Another way is with the option RegionFunction: Plot[x^2, {x, -5, 5}, RegionFunction -> Function[x, -5 < x < -1 || 1 < x < 5]]


9

Just in case somebody else needs it, here is a compiled answer. Thanks go out to 0x4A4D (for the actual solution), Michael Pilat (for the JLink part) and everybody else in here for the swift responses. Since this is apparently a bug of sorts in Mathematica 8, percent encoding the Greek letters in the URL will have to do. Reciting Michael Pilat's code ...


8

I believe you're looking for the option PlotRangeClipping -> False


7

The plots are misaligned because plot b doesn't have the exact same options as a, which causes it to be drawn slightly different. If you give the same options to plot b (PlotRange, AxesOrigin, and AxesLabel) b = Plot[-2 f'[z], {z, 0, 5}, PlotLegend -> "Theory", PlotRange -> {{0, 5}, {0, 1}}, LegendPosition -> {1.1, -0.4}, AxesOrigin -> {0, ...


7

Since you only want the numbers, you can get them by using Apply: CurveColor[phi_] = List@@Blend[{Color1, Color2, Color3}, Rescale[phi, {phimin, phimax}]] which will ensure that you always use the same blending functionality that Blend uses. Note, the use of Rescale.


7

m = {"computer", "экзамен", "elephant", "стол", "bread", "телефон", "exception", "desktop", "best", "колонка", "zoom", "saphire", "ярость"}; First Sort it: sortedm = SortBy[m, First@ToCharacterCode@# &] {"best", "bread", "computer", "desktop", "elephant", "exception", "saphire", "zoom", "колонка", "стол", "телефон", "экзамен", "ярость"} Then ...


7

FindClusters might give you a starting point. For simplicity, let's start with your definition for Ball: Ball[num_] := Table[{#1 Sqrt[1 - #2^2] Cos[#3], #1 Sqrt[ 1 - #2^2] Sin[#3], #1 #2} &[ RandomReal[NormalDistribution[1, 0.5]], Random[Real, {-1, 1}], Random[Real, {0, 2 Pi}]], {num}] By using the function FindClusters with the Method -...


7

SeedRandom[1]; Graphics3D[{RandomColor[], JoinForm["Round"], CapForm["Round"], AbsoluteThickness[3], BSplineCurve@#} & /@ RandomReal[{-10, 10}, {40, 10, 3}]] Replace BSplineCurve@# with Tube @ BSplineCurve@# to get: Update: Minimal modification of your code: SeedRandom[123] stringPack = ParametricPlot3D[randomStrings[s], {s, -...


7

ListDensityPlot Normal[ListDensityPlot[RandomReal[10, {100, 3}], InterpolationOrder -> 0, ImageSize -> Large, Frame -> False]] /. Polygon[x_, ___] :> {Hue@RandomReal[], EdgeForm[Gray],Polygon[x]} SeedRandom[1] ListDensityPlot[RandomReal[10, {100, 3}], InterpolationOrder -> 0, ImageSize -> Large, Frame -> False, ColorFunction ->...


7

You can use multiple mesh functions in a plot, each with its own mesh definitions: Plot3D[ Sin[x - y] + Cos[x + y], {x, -10, 10},{y, -10, 10}, PlotPoints -> {30, 30}, PlotRange -> {{-10, 10}, {-10, 10}, {-3, 3}}, Mesh -> { Range[-5, 5, 0.5] (*"regular" mesh*), {(*your own special lines*) {-1, Directive[Thick, Red]}, {0,...


7

Aha, finally here comes a chance to share my implmentation of 2nd order absorbing boundary condition (ABC). To understand why the b.c. is implemented in this way, one may refer to Chapter 6 of Lloyd N. Trefethen, Finite Difference and Spectral Methods for Ordinary and Partial Differential Equations but to be honest I myself don't understand the underlying ...


6

The specification RFC1738 : "Uniform Resource Locators" states that: The characters ";", "/", "?", ":", "@", "=" and "&" are the characters which may be reserved for special meaning within a scheme. No other characters may be reserved within a scheme. [...] only alphanumerics, the special characters "$-_.+!*'(),", and reserved ...


6

You need to evaluate numerically the points, using N[]. Morevoer, I always suggest you to use the PlotRange->All option for ListPlot. Here is the code: p1 = Table[(Binomial[2000, k]*StirlingS2[1386, k]*k!)/(2000^1386), {k,1, 1386, 1}] ListPlot[p1 // N, PlotRange -> All] This shows all the values starting from k=1.


6

It appears that Export to "GIF" in Mathematica 7 fails (with a corrupt file) if the image frames (source elements) are not all the same size. I'm surprised I don't remember this problem, but then again I don't remember a lot of things these days. Anyway, a hackish solution for now: bbox = MapThread[Max, Rasterize[#, "RasterSize"] & /@ list]; list2 = ...


5

It's just an application of the rules of differentiation, which we can implement by writing our own function: deriv[f_, g_[x_]] := Module[{z}, Simplify[D[f /. x :> InverseFunction[g][z], z]] /. z :> g[x] ] deriv[Log[x^2]^2, Log[x]] (* ==> 4 Log[x^2] *) The variable x in this call has to be undefined so it doesn't get evaluated to something ...


5

Simon Woods already gave what is arguably the canonical answer, but I always like seeing and sharing alternatives. Since one of the operations here is a duplicate-removal we can adapt some of the methods described in Delete duplicate elements from a list. SeedRandom[3] a = RandomInteger[5, {9, 2}]; (* {{3, 5}, {0, 1}, {2, 0}, {0, 4}, {5, 2}, {2, 2}, {1, 0},...


5

It is all about rescaling, - visual with Overlay or @A.G. idea in the comment. So: L = Abs[Rescale[Accumulate[RandomInteger[{-1, 1}, 1000]]]]; S = 2 10^27 Abs[Rescale[Accumulate[RandomInteger[{-1, 1}, 1000]]]]; U = 50 Abs[Rescale[Accumulate[RandomInteger[{-1, 1}, 1000]]]]; ListPlot[Rescale /@ {L, S, U}, Joined -> True]


5

With Combinatorica, you should usually use MakeGraph rather than Graph directly. Here are some expressions that create the graph you want and which can be easily adapted for use with any graph that you've defined appropriate vertices and edges symbols for: Needs["Combinatorica`"] crds = {{1, 10}, {2, 4}, {10, 5}, {20, 10}}; vertices = Range[Length[crds]]; ...


5

I'll work with a built-in for the random point generation. If this is not in version 7 you can still use RandomReal. ball[n_] := RandomVariate[NormalDistribution[], {n, 3}] bl = ball[10^4]; Graphics3D[{AbsolutePointSize[2], Point[bb]}, Boxed -> True, BoxRatios -> {1, 1, 1}, SphericalRegion -> True] Now we can erode clumps of points at random ...


5

To visualize the deleting process. (* generate random data*) data = RandomVariate[NormalDistribution[1, 3], {5000, 3}]; (* generate random delete centers*) pt = RandomChoice[data, 30]; (* generate random outer delete centers say at least away from mean by 10 *) ptouter =RandomChoice[Complement[data, Nearest[data, Mean@data, {Infinity, 10}]], 30]; f = ...


5

There are two ways: Calculate the density analytically. For the distribution you use this is difficult but since this for producing something pretty, and not for accuracy, you can consider using a different distribution. Approximate the distribution numerically. I'm going to do no. 2. below. I don't have version 7, so it is just a guess that these ...


Only top voted, non community-wiki answers of a minimum length are eligible