# Tag Info

352

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 ...

191

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 ...

96

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, ...

49

In this answer, I will concentrate on the colors only to create something like this Copying the colors from python is a very fast way to get similar results. Nevertheless, the best way to understand what's happening is still to read the underlying publication that was used in seaborn: A colour scheme for the display of astronomical intensity images ...

47

If you want to make several sequences of the Collatz function for turning it into a graph, you probably want to memorize, which parts you already calculated. What we try to do is to create a graph like this (image from xkcd) When we would calculate the whole chain for each number until it (hopefully) reaches the end sequence 8,4,1 we do a lot of work over ...

36

Manipulate[ ParametricPlot[({Sin[n t1], Sin[(n - 1) t1]}), {t1, 0, 2 Pi}, Epilog -> {Red, PointSize[Large], Table[If[OddQ[i + j], Point[{Cos[Pi i/(2 (n - 1))], Cos[Pi j/(2 (n))]}]], {i, 2 n - 3}, {j, 2 n - 1}]}], {{n, 5}, 2, 20, 1}] General Case I We can generalize to the Lissajous curve specified by the two non-negative ...

33

Using color functions efficiently in data visualizations is more of an art than a recipe, so don't worry if you're not "good" at it yet. It's only a matter of time :) Copying the color schemes from seaborn: The best way to mimic those color schemes in Mathematica would be to copy the RGB values from seaborn for your preferred color scheme. You can find ...

31

Styling closer to your example, using The Toad's colors: colors = {RGBColor[{0.9312692223325372, 0.8201921796082118, 0.7971480974663592}], RGBColor[{0.8822898168737189, 0.695820866705742, 0.7065457119485431}], RGBColor[{0.8135380254700676, 0.5705055182357822, 0.639280859468155}], RGBColor[{0.7195800708349119, 0.45537982893127477, ...

30

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 ...

30

Fortunately, Wikipedia has the answer, as long as we are content to restrict ourselves to non-intersecting closed polygons. This will probably be an acceptable limitation, given that excessively complicated plot markers tend to look slightly distracting anyway. Because we seek an aesthetic rather than rigorously well defined result, we do not need to be ...

29

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}]

29

Based on Oleksandr's excellent design idea here is my reimplementation of his package which offers much richer set of shapes. How to install the package The most recent version of the package can be installed from GitHub by evaluating the following: (* Load the package code *) package = ...

29

This can be done more-or-less easily with a combination of options for AxesOrigin, PlotRange, and PlotRangePadding and the CustomTicks package (for easy outward-facing ticks). Needs["CustomTicks"]; GapAxes[plot_Graphics, ticks : {{x__}, {y__}}, scalefactor_: Automatic] := With[ {prange = ticks[[All, 1 ;; 2]], s = Flatten@{scalefactor /. Automatic ...

27

This is the Collatz function I know: Collatz[1] := {1} Collatz[n_Integer] := Prepend[Collatz[3 n + 1], n] /; OddQ[n] && n > 0 Collatz[n_Integer] := Prepend[Collatz[n/2], n] /; EvenQ[n] && n > 0 Generating a graph from this is easy: Graph[(DirectedEdge @@@ Partition[Collatz[#], 2, 1]) & /@ Range[500] // Flatten // Union, ...

26

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", "---"}, ...

23

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: ...

22

maybe this will provide a little insight: first look at the evaluation points used by ContourPlot: f[x_?NumericQ, y_?NumericQ] := (Sow[{x, y}]; Sin[3.2 x]*Sin[1.3*y] - 2.1*Sin[1.3*x]*Sin[3.2*y]); {plot, dat} = Reap[ContourPlot[f[x, y] == 0, {x, 0, 2}, {y, 0, 2}, PlotPoints -> 50, ContourStyle -> Red]]; Row[{ ...

22

Update: I have realized since writing this that the below algorithm is not exactly what Plot uses anymore. Given the reference in my reference, a book written by someone who knew Mathematica very well, I guess that the algorithm has been changed in more recent versions of Mathematica. The algorithm that Plot uses is explained in the link provided by ...

21

Graphics[{Circle[{0, 0}, 1, {0, Pi}], Circle[{0, 0}, .03], Line[{{1, 0}, {1, -.1}, {-1, -.1}, {-1, 0}}], Rotate[ Line[{{.03, 0}, {.6, 0}}] , #, {0, 0}] & /@ {0, Pi/2, Pi}, GeometricTransformation[ Piecewise[{ {{Red, Line[{{.8, 0}, {1, 0}}], Black, Line[{{.2, 0}, {.5, 0}}], Rotate[{Red, Text[#, {.75, 0}, {0, ...

21

This package provides couple of functions for plotting commits data from GiHub: Import["https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/Misc/GitHubPlots.m"] GitHubDateListPlot["hadley", "plyr"] GitHubBarChart["hadley", "plyr"] I think these plots are similar enough to the image in the question. There are number of ...

20

If you are comfortable using undocumented and unsupported functionality we can do this with a ScalingFunctions option as I did for ListLogLinearPlot for the whole real numbers. (* listability *) (self : fn[off_, scale_])[x_List] := self /@ x (self : invfn[off_, scale_])[x_List] := self /@ x fn[off_, scale_][x_?NumericQ] := If[x < off, Log[x], ...

20

Here is an alternative answer. Of course, since you answered your own question, you may not need this. But I think the following is a viable alternative that may end up looking comparable, and has additional dynamic features. Instead of ListPlot, just use BubbleChart. data = ConstantArray[Range[5], 4] + Range[0, 6, 2]; newData = Map[MapIndexed[Join[#2, ...

20

If you are serious about using this extensively, consider making a function based on CreateDocument... Here is one way to pursue Szabolcs's line of thought. What follows is a function based on CreateDocument[] that can be used in conjunction with the (now somewhat neglected) option DisplayFunction, which handles where the output of graphics functions ...

19

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 ...

19

Method 1: FindCurvePath (as mentioned by Yves Klett). This method is simple, but unfortunately, there are small issues (as shown in plots), that the curves are not identified perfectly. arrayData = Flatten[Function[{lst}, {First @ lst, #} & /@ Rest[lst]] /@ originalData, 1]; curvesPosition = FindCurvePath[arrayData]; ListPlot[curves = ...

19

Ok, here's a very brief toy example while I don't have access to my desktop computer at work. It's easy enough to figure out, that a LogPlot of f is basically the plot of Log[f[x]]. And A LogLinearPlot is the plot of f[Exp[x]]. But we can extend this to arbitrary scalings of the axes. I start with defining a piecewise function which maps x values between 0 ...

19

I think SmoothDensityHistogram (docs here) is what you are looking for: data1 = RandomVariate[BinormalDistribution[{0, 0}, {2, 3}, 0.5], 100000]; data2 = RandomVariate[BinormalDistribution[{3, 4}, {2, 2}, .1], 100000]; data = data1~Join~data2; This is just some random sample data. If you plot it using ListPlot, you obtain the "blob" you mentioned: ...

19

Wanna listen to a story? :) It was around 2002 when I finally became fed up with ParametricPlot3D[] and its inability to adaptively plot space curves. Recall that this was the old Graphics[] system where all the pictures were effectively done in PostScript. Thus, I set out to look for a way to adaptively plot curves in general. I was at the time very ...

18

You can make plots sort of like this: Or this: Or this: ...by taking advantage of Image and Fourier using the following code. The plots will have a brightness proportional to the multiplicity of the root, and you can change the colors, convolution properties, etc., although it doesn't provide axes (you'll have to figure that out yourself). ...

18

Update ticks[x1_, x2_] := {#/10 + π/2, #} & /@ FindDivisions[{10 (x1 - π), 10 (x2 - π)}, 20] funcs = Table[3 + BesselJ[i, 10 (x -π/2)], {i, 0, 3}]; PolarPlot[funcs // Evaluate, {x, -π/2, 3π/2}, PolarAxes -> Automatic, PolarTicks -> {ticks[0, 2 π][[2 ;; -2]], Automatic} ] (*thanks @kguler 's and @rm-rf 's advice*) Manipulate ...

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