Tag Info

Hot answers tagged

5

Unless you specify the tick mark length in your tick specifications tick marks are rendered with default length and style. tickF = {#, DateString[#, {"MonthNameShort", " ", "Day", "/", "YearShort"}]} & /@ AbsoluteTime /@ DateRange[##, {10, "Day"}] &; Example data: data = {{3368649600, 8}, {3369427200, 10}, {3370291200, 12}, {3370636800, ...


4

ClearAll[f, g] f = ConditionalExpression[(1/27)*(#^4 - 6 #^3 + 12 #^2 + 19 #), 0 <= # <= 5] &; g = InverseFunction[f]; Grid[Partition[#, 2] &[Plot[#, {x, 0, #2}, PlotLabel -> #3, ImageSize -> 300] & @@@ {{f[x], 5, "f[x]"}, {g[x], 10, "g[x]"}, {{f[x], g[x]}, 5, "{f[x], g[x]}"}, {f[x] - g[x], 5, "f[x]- g[x]"}}]] Update: ...


4

Looks fine to me, once you get your aspect ratio proper. foci = {{-3, 25}, {2, 20}}; ContourPlot[ Total[EuclideanDistance[#, {x, y}] & /@ foci], {x, -5, 5}, {y, 10, 30}, AspectRatio -> 2, Epilog -> {Black, PointSize[Large], Point@foci}] or your horizontal and vertical ranges equal: foci = {{-3, 25}, {2, 20}}; mycontplot = ContourPlot[ ...


3

Related Q/A: ListContourPlot: delete some contour lines, but keep the colors In addition to Epilog (Harry's answer) or MeshFunctions (rahul's comment) you can also use ListContourPlot: ListContourPlot [data, ImageSize -> 400, Contours -> {{0.8, {Thick, Black}}, ##& @@ ({#, None} & /@ Range[Min@data, Max@data, .0025])}, PlotLegends -> ...


3

Epilog Approach: line = Take[#, 2] & /@Select[Flatten[ Table[{x, y, Sin[x^2 + y]}, {x, 0, 1, 0.01}, {y, 0, 1, 0.01}], 1], Abs[#[[3]] - 0.8] < 0.002 &] then: data = Flatten[ Table[{x, y, Sin[x^2 + y]}, {x, 0, 1, 0.1}, {y, 0, 1, 0.1}], 1]; density = ListDensityPlot[data, ImageSize -> Large, PlotLegends -> Placed[BarLegend[Automatic, ...


3

Is this what you would like? SphericalPlot3D[1, {θ, 0, Pi/2}, {ϕ, 0, 2 Pi}, RegionFunction -> Function[{x, y, z, θ, ϕ, r}, z > 0 && (x - Cos[π/4] Cos[π/3])^2 + (y - Cos[π/4] Sin[π/3])^2 + (z - Sin[π/4])^2 <= 1/10], PlotRange -> 1.5] Response to comment: plot = SphericalPlot3D[1, {θ, 0, Pi}, {ϕ, 0, 2 Pi}, ...


3

One approach is to use Inset. DateListPlot[{1, 1, 2, 3, 5, 8, 11}, {2000, 8}, Prolog -> Inset[Graphics[{GrayLevel[.6], Rectangle[Scaled[{.5, .1}], Scaled[{.7, .3}]], Rectangle[Scaled[{.7, .3}], Scaled[{.9, .5}]], Rectangle[Scaled[{.9, .5}], Scaled[{1.1, .7}]]}]]] Some experimentation may be necessary to place multiple shaded areas in their ...


2

Maybe this? c0 = Directive[RGBColor[0.9500000000000001`, 1.`, 0.64`], Opacity[0.5`]]; {c1, c12, c2} = {RGBColor[0.6`, 0.6`, 0.6`], RGBColor[0.6`, 0.6`, 0.6`], RGBColor[0.6`, 0.6`, 0.6`]}; Show[ ParametricPlot3D[{Cos[u] Cos[v], Cos[u] Sin[v], Sin[u]}, {u, 0, π/2}, {v, 0, 2 π}, PlotPoints -> 50, Mesh -> {{1/30}, {1/30}}, MeshStyle -> ...


2

You can also use "FrameStyle"->Thick in Version 10: ContourPlot[y - x^2, {x, 0, 1}, {y, 0, 1}, ContourStyle -> Directive[Thick, Black, Opacity[1]], FrameStyle -> Thick, PlotLegends -> BarLegend[Automatic, "FrameStyle" -> Thick]] In Version 9 (Windows 8 x64) BarLegend[Automatic, "FrameStyle" -> Thick] renders only three sides of the ...


2

Sorry, I've realized the trick later g = Rasterize[ Plot[Cos[2 \[Pi] x], {x, 0, 1}, Axes -> None, PlotRange -> {{0, 1}, {-1, 1}}], Background -> None, ImageResolution -> 100]; Plot[Sin[2 \[Pi] x], {x, 0, 1}, PlotRange -> {{0, 1}, {-1, 1}}, Background -> None, Prolog -> Inset[Graphics[g], {0.5, 0}, Automatic, 1]] Just matter to add ...


2

Using ListPlot3D with Mesh: data = Table[{i, j, Sin[j^2 + i]}, {j, 0, 2 Pi, 2 Pi/11}, {i, 0, 2 Pi, 2 Pi/24}]; Dimensions[data] (* {12, 25, 3} *) colors = Directive[Thick, #] & /@ ColorData["Rainbow"] /@ Range[0, 1, 1/11]; lp3d = ListPlot3D[Join @@ data, PlotStyle -> Opacity[0.3], BoundaryStyle -> None, Mesh -> {0, Thread[{Range[0, 2 Pi, 2 ...


2

Create Data and export so we can have working files. data = Table[{i, Sin[ a i]}, {a, 3}, {i, 0, 2 Pi, 0.1}]; Export[StringJoin[ToString[#], "a.dat"], data[[#, All]]] & /@ Range@Length[data]; Proceed to read the data now: p = Import[StringJoin[ToString[#], "a.dat"]] & /@ Range[3]; Graph ListPlot[Evaluate[p], Joined -> True] Graph the ...


1

You just need more PlotPoints: tVect = Get["tVect.dat"] ; vVect = Get["vVect.dat"] ; pTrain = Partition[Riffle[tVect, vVect], 2]; f = Interpolation[pTrain, InterpolationOrder -> 0] ; Plot[f[s], Evaluate[Join[{s}, First[f["Domain"]]]], PlotPoints -> 200]


1

plots = DateListPlot[CountryData[#, {"Population", {1800, 2020}}], PlotLabel -> "population of " <> #, ImageSize -> 250] & /@ {"Poland", "Austria", "Switzerland", "Germany"}; GraphicsGrid[{{plots[[1]], plots[[2]]}, {plots[[3]], plots[[4]]}}, ImageSize -> 500] sol = Solve[{2 x + 3 y == 5, 3 x + 4 y == 11}]; xyVals = ...


1

I'm not sure if I got the question right but here is what I think you want to do: The argument v is the vector along which you want to plot your function. f[a_, b_, c_, v_] := (v[[1]] x + a)^2 + (v[[2]] x + b)^2 + (v[[3]] x + c)^2 The plot you described could be set up like this Show[ Plot[f[1, 2, 3, {1, 0, 0}], {x, 0, 1}], Plot[f[1, 2, 3, -{1, 1, ...


1

e[pos_, parms_] := SquaredEuclideanDistance[pos, -parms] parms = {2, 3, 4}; (* Your {a,b,c} *) Show[Plot[e[{x, 0, 0}, parms], {x, 0, 1}], Plot[e[-{x, x, x}, parms], {x, -1, 0}], PlotRange -> Automatic] Plotting it dynamically e[pos_, parms_] := SquaredEuclideanDistance[pos, -parms] Manipulate[ Show[Plot[e[{x, 0, 0}, {a,b,c}], {x, 0, 1}], ...


1

Illustrating the problem with a simple example: f = #^2 &; g = InverseFunction[f]; InverseFunction::ifun: Inverse functions are being used. Values may be lost for multivalued inverses. g[f[3]] -3 As the message says, there may be multiple solutions. Only one is returned.


1

Your data needs to be in the form {{x1, y1}, ..., {xn, yn}}. rawData = {{0., {1.88873*10^-15}}, {0.1, {0.0269271}}, {0.2, {0.0534832}}, {0.3, {0.0796794}}, {0.4, {0.105526}}, {0.5, {0.131035}}, {0.6, {0.156213}}, {0.7, {0.181072}}, {0.8, {0.20562}}, {0.9, {0.229864}}, {1., {0.253815}}}; data = rawData /. {m_, {n_}} :> {m, n} ListPlot[data, ...


1

The specific reason for the error message is that "StartingInitialConditions" contains T[0] = 0. It should be T[0] == 0. The fact that f'[0] == 0 is inconsistent with BC2 and that there are too few "StartingInitialConditions" for T also may cause difficulties. Certainly, with f'[0] == 0 and T'[0] == -10 added, the integration proceeds further before ...



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