Tag Info

Hot answers tagged

313

I have to confess that I see this as a proper challenge, as I am usually quite creative in finding/combining functions to provide a desired behavior. So I will give it another try. which is generated using box[x_, x1_, x2_, a_, b_] := Tanh[a (x - x1)] + Tanh[-b (x - x2)]; ex[z_, z0_, s_] := Exp[-(z - z0)^2/s] and r[z_, x_] := (*body*).4 (1.0 - .4 ...


181

This might get me suspended from the site butt I cannot resist. The shape you are looking for can probably be approximated (depending how anal you want to be about the outcome) by two assymetric probability distributions. The obvious choices would be a Poasson or a log normal distribution. I will use the latter as it is continuous. Now the bummer is that ...


88

Parametric Buttocks Manipulator Manipulate[ ParametricPlot3D[{ (e u^p + (1 + (c - a u) (u - 1)) Cos[t]^2) Sin[t], (e u^p + (1 + (d - b u) (u - 1)) Cos[t]^2) Cos[t], 2 u}, {t, -0.2, Pi + 0.2}, {u, 0, 1.1}, Lighting -> "Neutral", Mesh -> None, PlotStyle -> Directive[Specularity[0], RGBColor[0.92, 0.85, 0.73]], Axes -> False], {{a, ...


28

Well, an unusual question to answer, what about something like this Plot3D[.7*(1 + Tanh[1 - (2*Y^2 + X^2 + X^4)]) - .3*Exp[-X^2/.0025]* Exp[-(Y - .1)^2/.15] - .2*(Exp[-(X - .7)^2/.02]*Exp[-(Y - .0)^2/.08] + Exp[-(X + .7)^2/.02]*Exp[-(Y - .0)^2/.08]), {X, -1, 1}, {Y, -1, 1}]


24

First define the Morse code (from rosettacode.org with corrections by @evanb) morsecode = (#1 -> Characters[#2]) & @@@ { {"a", ".-"}, {"b", "-..."}, {"c", "-.-."}, {"d", "-.."}, {"e", "."}, {"f", "..-."}, {"g", "--."}, {"h", "...."}, {"i", ".."}, {"j", ".---"}, {"k", "-.-"}, {"l", ".-.."}, {"m", "--"}, {"n", "-."}, {"o", "---"}, ...


20

Your comment raises interesting question: I got everything simply faded and flat, while in the example - its all bright and sharp I think the problem is related to the fact that Mathematica's graphical functions always work in linear colorspace. Starting from Pickett's solution with better resampling method, in version 10.0.1 we obtain: ...


20

Some function definitions first. AkimaInterpolation[] stolen from here (Thanks JM, wherever you are!): AkimaInterpolation[data_] := Module[{dy}, dy = #2/#1 & @@@ Differences[data]; Interpolation[Transpose[{List /@ data[[All, 1]], data[[All, -1]], With[{wp = Abs[#4 - #3], wm = Abs[#2 - #1]}, If[wp + wm == 0, (#2 + #3)/2, (wp #2 + wm ...


14

I wrote the ColorBar package exactly for this purpose and it makes such modifications easy. The README.m should give you all the instructions you need, but I'll summarize it here. After installing the package (copy ColorBar.m to FileNameJoin[{$UserBaseDirectory, "Applications"}]), do the following: ColorBar["TemperatureMap"] Now you can click on the ...


13

image = Import["http://i.stack.imgur.com/6YRfK.jpg"]; If you want to use your f, uRange and vRange as the arguments to ParamatricPlot3D, you need to wrap each with Evaluate: f = {u, Sin[v]*(u^3 + 2 u^2 - 2 u + 2)/5, Cos[v]*(u^3 + 2 u^2 - 2 u + 2)/5}; uRange = {u, -2.3, 1.3}; vRange = {v, 0, 2 Pi}; ParametricPlot3D[Evaluate@f, Evaluate@uRange, ...


11

Just a combination of Graphics3D objects Graphics3D[{Scale[ Cylinder[{{0, 0.9, -0.5}, {2, 0.7, 0.5}}, 0.75], {1, 0.95, 1}], Scale[Cylinder[{{0, -0.9, 0}, {2, -0.7, 0}}, 0.75], {1.0, 0.95, 1}], Scale[Cylinder[{{-1.1, 0, 0}, {-0.3, 0, 0}}, 1.5], {1, 1, 0.5}], Scale[Sphere[{0., 0.75, -0.25}, 1.05], {1.1, 0.9, 1}], Scale[Sphere[{0., -0.75, 0.1}, 1.05], {1.1, ...


9

On-screen, lines are always at least 1 pixel wide in Mathematica, regardless of the thickness setting. Not sure what you tried with Opacity, as it seems to be possible to achieve the same effect: PlotStyle -> Directive[AbsoluteThickness[1], Opacity[.05]]


8

You have to add the index for the colors to LineLegend Legended[Grid[{{Show[oniplot], Show[cpplot]}}], LineLegend[97, {"factor = 2", "factor = 3", "factor = 4", "factor = 5"}]] In order to have the legend above the plots and with markers: Legended[GraphicsGrid[{{Show[oniplot], Show[cpplot]}}], Placed[LineLegend[97, {"factor = 2", "factor = 3", ...


8

Epilog and FullGraphics with RotationTransform do the main part of the visualization shift = {1, -1} Log[2 π]/Sqrt[2]; scale = {1, 1}/Sqrt[2]; ao = {0.5, 50}; ListLogLogPlot[{0}, Axes -> False, PlotRange -> {{0.01, 10}, {0.1, 100}}, Frame -> True, GridLines -> Automatic, FrameLabel -> {Style["x axis", 16], Style["v axis", 16]}, ...


8

data = RandomReal[ {0, 200}, {200, 2}]; center = {50, 50}; centereddata = (# - center) & /@ data; angles = N[ArcTan[#[[1]], #[[2]]]/Degree] & /@ centereddata; radiis = N@Sqrt[#[[1]]^2 + #[[2]]^2] & /@ centereddata; note you need to use Degree to put the angles back to radians here.. polardata = Transpose[Join[{angles Degree}, {radiis}]]; ...


8

[Edited to correct the bin definition.] You could use SectorChart. The trick is to ensure that your bin widths sum to 360° and that the first bin charted starts at zero. Firstly, and borrowing shamelessly from @george2079's answer [and subsequent correction], define the bins: bins = Table[a , {a, -180, 180, 30}]; Next create the sector chart data: ...


7

a = -0.06; b = 0.04; c = 0.1; d = 0.54; f = (a x^3 + b x^2 + c x + d) Sqrt[1 - x^2]; To view the volume, you can use: RevolutionPlot3D[f, {x, -1, 1}, RevolutionAxis -> {1, 0, 0}] the volume is: v = Integrate[Pi f^2, {x, -1, 1}] (*1.263*)


7

One solution is to transform your 2d contour plot into 3d coordinates. For this, you have to look at the underlying representation of the Graphics that ContourPlot creates. This is usually a Graphics[GraphicsComplex[coords,...],...] object, where coords are the coordinates of the points used. Let us create simple example data and plot them data = ...


6

You tried to decrease the width of the lines to below the minimum width. In order to achieve the same effect you can increase the size of the image instead. x = RandomReal[1, 10000]; y = RandomReal[1, 10000]; Show[ImageResize[Rasterize@ListLinePlot[{Thread@{x, y}}, ImageSize -> 10000], 300], ImageSize -> 300]


6

Although n is allowed to take non integer values, you probably intend it to take only integer values, so this is a job for DiscretePlot DiscretePlot[Log[n!]/(n Log[n] - n), {n, 10, 1000, 10}, PlotRange -> All, Frame -> True]


6

The comments to this question answer it fully, but I think we should get a answer on record rather than closing the question as a "simple error" or "easily found in documentation" as neither applies. Plot styling was [modified] in V10 with plot themes [and in other ways]. There have been several changes in the default behavior. [This is not] a bug, just ...


6

See : Language Overview: http://reference.wolfram.com/language/guide/LanguageOverview.html and Wolfram Language Syntax: http://reference.wolfram.com/language/guide/Syntax.html Refer to the documentation frequently until you learn the language syntax. $Version "10.0 for Mac OS X x86 (64-bit) (September 10, 2014)" a = -0.06; b = 0.04; c = 0.1; d = ...


5

Rolled back to the very first version: ClearAll[x]; Plot[Evaluate[Range[50] + x], {x, -5, 5}, PlotLegends -> "Expressions"] Update -2: For other users who might have liked the deleted version: Plot[Evaluate[{1, 2, 3, " ... ", 49, 50} + x], {x, -5, 5}, PlotLegends -> "Expressions"] ... and a few variations: Plot[Evaluate[Range[50] + x], {x, ...


5

You have the import. dates = Import["http://www.sudomemo.net/statistics/firstSeenDump.php", "JSON"] Gather them up by day and count how many in each day. dailyGather = GatherBy[dates, Take[DateList[#], 3] &]; dailyVisits = {Take[DateList[dailyGather[[#, 1]]], 3],Length[dailyGather[[#]]]} & /@ Range[First@Dimensions[dailyGather]]; Plot the ...


5

You're about to realize that derivatives in the real world are a pain. You have to aggregate data as much as possible and average it a lot until you get a "textbook-quality second-derivative! dates = DateList /@ Import["http://www.sudomemo.net/statistics/firstSeenDump.php", "JSON"] Grouping by days and counting: datesDays = Tally@dates[[All, ;; 3]]; ...


5

The short answer is there is no solution. The problem alluded to in the tutorial is that the derivative expression -Sqrt[y[x]^3] (or equivalently y[x]^(3/2)) is discontinuous in a complex neighborhood of y[0] == -2. The discontinuity arises from the branch-cut choice in Mathematica. As for NDSolve, it fails to complete a solution because it tries to ...


5

Looking at the rather dismal automatic placement of contour labels in the example Sin[x y], I thought it may be worth pointing out that you can often get better results with customized placement. For this, I devised a function burnTooltip in this answer. Here is how to use it for this question: Options[burnTooltips] = {ImageSize -> 360, ...


5

With some random numbers rNumbers = RandomReal[{0, 1}, 100] you can get a cumulative histogram with a log-log scale using Histogram[rNumbers, "Log", {"Log", "CumulativeCount"}]


5

ListPlot[MapIndexed[Style[#, colours[[#2]], PointSize[.1]] &, angles], AspectRatio -> 1] or ListPlot[Style[#, #2, PointSize[.1]] & @@@ Transpose[{angles, colours}], AspectRatio -> 1] Update: make those circles into squares, and make them all fill up the plot? As in no spaces between each one ArrayPlot[Transpose@Partition[colours, ...


5

Another way to draw rectangles using Graphics: Graphics[MapThread[{#2, Rectangle[#1, #1 + π/8]} &, {angles, colours}]]


5

I answered this question for indexed color schemes here: How to change element color in Periodic Table? The gradient color schemes have a simpler structure, e.g.: However it seems unclear to me what the desirable semantics of a general function for gradient schemes would be. I think from your description that you wish to replace an existing color ...



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