Tag Info

Hot answers tagged

5

It is not clear how you want the filling done. Here is one filling. f[x_] := x f2[x_] := x - (1/6) f3[x_] := x + (1/6) line1 = Line[{{10, 0}, {10, 10}}]; line2 = Line[{{0, 10}, {10, 10}}]; line3 = Line[{{9, 9}, {10, 9}}]; lineStyle = {Thick, Black, Dashed}; Plot[{f[x], f2[x], f3[x]}, {x, 9, 10}, Epilog -> {Directive[lineStyle], line1, line2, line3}, ...


4

Eb = 2 10^7; b = 1/4; t0 = 1/2; L = 5; t[x_] := (t0 (L + x))/L; s = DSolve[{Eb (b t[x]^3)/12 y''''[x] == -1, y''[0] == 0, y''[L] == 0, y[0] == 0, y[L] == 0}, y, x][[1]]; displacement = y[x] /. s[[1]]; u = {-x2 D[displacement, x], displacement}; VectorPlot[u, {x, 0, L}, {x2, -4, 4}]


4

Here's a simple way to enumerate all the conditions: fs = {x, y, z, 0}; conds = Table[{Equal @@ fs1, And @@ Table[First@fs1 >= f, {f, Complement[fs, fs1]}]}, {fs1, Subsets[fs, {2}]}] (* {{x == y, x >= 0 && x >= z}, {x == z, x >= 0 && x >= y}, {x == 0, x >= y && x >= z}, {y == ...


4

Also Plot[{9, 10, f1[x], f2[x], f3[x]}, {x, 9, 10}, Epilog -> {Directive[lineStyle], line1, line2, line3}, Filling -> {{5 -> {{2}, {Blue, Green}}}, {4 -> {{1}, {Red, Orange}}}}, BaseStyle -> Thick]


4

Based on your code, we can first create a function PoAGen to generate mean PoA values as follows: Clear[PoAGen] PoAGen[nodes_, links_, n_: 1000] := Module[ {an = 10, al = 1, s, M, id, od, wd, x, poa, PoA}, Cases[_?NumericQ]@ Table[s = DirectedGraph[RandomGraph[{nodes, links}], "Acyclic"]; M = al*Transpose[AdjacencyMatrix[s]]; id = an + ...


3

New way The OP mentioned ContourPlot but its behavior is V10 makes my original solution practically unusable except for a very rough plot. Another approach is to solve the equation for all the roots in a given region. From the ContourPlot, one can see there are two types, ones that cross y == -5 and ones that cross y == 5. We can use NDSolve to solve the ...


3

Is this ok? layout = Overlay[{ Show[#, Frame -> {{True, True}, {True, False}}, FrameStyle -> {{Automatic, Automatic}, {{FontOpacity -> 1, Opacity@0}, Automatic}}, FrameTicks -> {{Automatic, All}, {All, None}}, ImagePadding -> 35, Axes -> False] , ...


3

list = {1, 5, 2, 6, 3}; ListPlot[{#} & /@ Transpose[{Accumulate[list], Table[1, {Length[list]}]}], PlotMarkers -> list, Axes -> {True, False}, AspectRatio -> 1/10]


3

not quite what you asked for, but possibly useful: relationships = {1 <-> 2, 2 <-> 3, 2 <-> 4, 3 <-> 5, 2 <-> 6, 6 <-> 7, 4 <-> 8, 4 <-> 9}; numNodes = Max[relationships[[All, 2]]]; sizes = RandomReal[{0.25, 1}, numNodes]; xCoords = {0, 1, 2, 2, 3, 3, 4, 5, 5}; vars0 = Array[a, 9]; Manipulate[ vars = ...


3

Use the option RegionFunction: ss = Table[Sin[i + j^2] + RandomReal[], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}]; ListContourPlot[ss, Contours -> 10, PlotLegends -> Automatic, RegionFunction -> Function[{x, y, z}, 20 <= Norm[{x, y}] < 30]]


3

Given that you have three lists with data, one for the x coordinates, one for the y coordinates and one for the error bar, this is pretty easy. We just have to generate a new list where every element is picked from corresponding positions of the respective lists. This combined list is then turned into the {{x, y}, ErrorBar[error]} triplet required by ...


3

You might be having a problem with AxesOrigin being off the plot. We can force this to happen by specifying both AxesOrigin and PlotRange: Plot[x^2, {x, 0, 1}, AxesOrigin -> {-1, 0}, PlotRange -> {{0, 1}, {0, 1}}] If setting PlotRange -> All or PlotRange -> Full doesn't do the trick, you can force the axes into the lower-left corner using: ...


3

you can also use RegionPlot RegionPlot[{function <= 1/2, function > 1/2}, {a, 0, 4 Pi}, {c, 0, 4 Pi}, PlotStyle -> {Red, Green}]


3

ContourPlot[Cos[c] + Cos[a], {a, 0, 4 Pi}, {c, 0, 4 Pi}, Contours -> {1/2}, ContourShading -> {Red, Green}]


2

The main thing with the ListStreamPlot is that it needs a data in a form of list of {{x, y}, {vx, vy}} pairs. vx = Import["Re1000_c100_u.dat", "CSV"]; vy = Import["Re1000_c100_v.dat", "CSV"]; x = Table[j, {i, 0, Length[vx] - 1}, {j, 0, Length[vy] - 1}]; y = Table[i, {i, 0, Length[vx] - 1}, {j, 0, Length[vy] - 1}]; ListStreamPlot@MapThread[{{#1, #2}, ...


2

Animate[ParametricPlot3D[{x + a, y + a, x + y + a}, {x, -3, 3}, {y, -2, 2}, PlotRange -> {{-8, 8}, {-8, 8}, {-10, 10}}], {a, 0, 5}] Or, use PlotRange -> {{-2, 8}, {-2, 8}, {-5, 10}}. See also: Animate >> Possible Issues Fix PlotRange to stop animations from jiggling.


2

n = 64; l = {n/32, 3*n/64, n/16, 3*n/32, n/8, 3*n/16, n/4, 3*n/8}; m = RandomReal[{0, 1}, {n, n}]; ListLinePlot[m[[l]], PlotLegends -> l]


2

You can replace Map with Thread. Graphics3D[{{Blue, PointSize[0.02], Point[data]}, Thread[Text[Flatten[labels], 1.04 data]]}, Axes -> True, BoxRatios -> 1] However I would sugest you to create third list, which would adjust label position. Something like (here chosen randomly) labelsRelativePositions = Table[{RandomInteger[{-1, 1}], ...


2

I assume it is a bug based on the following findings: In v9.0.1 it does not happen. Adding Evaluated -> False does not fix it. Strangely Evaluated -> True does fix it. As you mention, other plotting functions, such as ParametricPlot3D, do not have this problem, regardless of the Evaluated setting. This is not an answer, just some arguments on why ...


2

It's not exactly what was asked for but it's another way to display the sought-after deformation. I thought I would share it because it's probably not well known how it can be done, and it seems appropriate to the problem at hand. First the OP's code computed this displacement: displacement (* (0.0001 (-125 x + 10 x^3 - x^4))/(5 + x)^3 *) Here is an ...


2

Actually, ChartStyle does work, but it does not apply the whole colour range to the first bar. This example, slightly modified from the documentation, shows what is actually going on. Table[DistributionChart[data, ChartElementFunction -> f, ChartStyle -> "DeepSeaColors"], {f, {"Quantile", "DensityQuantile", "FadingQuantile", "GlassQuantile"}}] ...


2

Use ParametricPlot3D to create the integrated curves as parametric curves along the lines {x,1} and {y,0}. Then use Show to combine the objects together. \[CapitalOmega] = Rectangle[{0, 0}, {1, 1}]; op = Laplacian[u[x, y], {x, y}] + 2; Subscript[\[CapitalGamma], D] = {DirichletCondition[u[x, y] == 0, True]}; \[CapitalPhi] = NDSolveValue[{op == 0, ...


2

Plot[{5 x, 10 x, 20 x, , x (20 - x)}, {x, 0, 20}, PlotRange -> {0, 150}, Ticks -> {None, {{100, Style[Overscript["ω", _], 16]}}}, AxesLabel -> {Style["g", 16], Style["ω", 16]}] Works in mathematica v10.0 I have deleted the [/Omega] and writing it back appears the Omega character.


1

Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameStyle -> {{Automatic, Black}, {White, White}}, FrameTicks -> {{Range[-1, 1, 0.5], Range[-1, 1, 0.5]}, {({#, Style[#, Black]} & /@ Range[0, 10]), None}}]


1

Export["mobius.stl", mobius] creates the desired file, which I can open with Photoshop CC, producing B&W top and side views. Presumably, more specialized software would give a true 3D image, although still B&W.


1

I don't really know what you mean about free space under the image, if you're talking about the white space below the x-axis ticks, try adding ImagePadding -> {{70, 70}, {50, 70.}} to your plot options.


1

list = {1, 5, 2, 6, 3}; NumberLinePlot[list] NumberLinePlot[Accumulate@list] ListPlot[Transpose[{list,Accumulate@list}]] Update: ... on the horizontal axis, there would be instead of accumulated numbers, dates that correspond to to the accumulated number ... in case of one graph ... there are selected months on the horizontal. list2 = ...


1

data = Transpose@{DateRange[Today, DatePlus[{9, "Week"}], "Week"], RandomReal[{25.5, 50.8}, 10]}; Using ToString avoids the problem: DateListPlot[ Function[{pair}, Tooltip[pair, ToString[NumberForm[pair[[2]], {3, 1}]]]] /@ data, Joined -> False, Filling -> Axis] Or, more compactly: DateListPlot[Tooltip[#, ToString[NumberForm[#[[2]], {3, ...


1

I know it's been more than two years since the question was asked but please allow me to answer nevertheless for future reference. According to Wikipedia articles on Mollweide and equirectangular projections, the function mollweidetoequirect that converts the former to the latter can be constructed as follows: lat[y_, rad_:1] := ArcSin[(2 theta[y, rad] + ...


1

It seems that the DiscreteMarkovProcess has directed edges, so you need use the [DirectedEdge] version in your EdgeLabels specification. In version 10 the following works: proc = DiscreteMarkovProcess[1, {{1/2, 1/2, 0, 0, 0}, {1/2, 1/2, 0, 0, 0}, {0, 1/2, 1/2, 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 1, 0}}]; ...



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