9
Space for the legend is available at the upper left
ListPlot[{
{2, 5, 2, 8, 6, 8, 3},
{1, 2, 5, 2, 3, 4, 3}},
PlotMarkers -> {"✶", 15},
Joined -> True,
PlotStyle -> {Orange, Green},
PlotLegends ->
Placed[
LineLegend[{"line1", "line2"},
LegendFunction -> "Frame"],
{.15, .8}],
Frame -&...
8
You did not put any location for Placed
ListPlot[{{2, 5, 2, 8, 6, 8, 3}, {1, 2, 5, 2, 3, 4, 3}},
PlotMarkers -> {"\[SixPointedStar]", 15}, Joined -> True,
PlotStyle -> {Orange, Green},
PlotLegends -> Placed[LineLegend[{"line1", "line2"},
LegendFunction -> (Framed[#, FrameMargins -> 0] &)], {0.1, 0.5}...
8
How about
French = Blend[{{0, Blue}, {1/2 - 0.1, White},
{1/2 + 0.1, White}, {1, Red}}, #1] &;
Then
French /@ (Range[15]/15.)
ContourPlot[x, {x, 0, 1}, {y, 0, 1}, ColorFunction -> French]
Any variation is possible: e.g.
French2 = Blend[{{0, Darker[Blue, 0.7]}, {0.15, Blue}, {1/2 - 0.05,
White},
{1/2 + 0.05, White}, {0.9, Red}, {1,...
7
The delta_function(t-t0) is used as an operator multiplied by some other function g(t) inside a definite integral over all t from plus to minus infinity and maps the function g(t) to a specific value g(t0) determined by the zero argument of the delta_function. To illustrate this look for example with a function t Cos[t] at
Integrate[(e/(Pi*((t - t0)^2 + e^...
6
Introduction
I recently had to do something similar, and figured I'd share my method - hopefully it's useful for people stumbling on this question.
As this was project-specific, I didn't really bother making this take a general directed acyclic graph as input. I will try and revisit this when I find time to do so.
Also, just for fun, let's make two 'mirrored'...
6
This is a possibility for what you want:
c = 2.998 10^8 ;
h = 6.62607015 10^-34 ;
Kb = 1.380649 10^-23 ;
i[l_, T_] := (2 Pi h c^2)/(l^5 (Exp[(h c)/(l Kb T)] - 1));
Plot[{i[l, 3000], i[l, 4000],i[l, 5000]}, {l, 0, 2.5 10^-6}, PlotRange -> All]// Quiet
I added //Quiet in the end because it complained about having to deal with such small numbers.
For ...
6
Lewin's book gives a useful continuation formula:
$$\operatorname{Li}_n^{(k_0,\dots,k_{n-1})}(z)=\operatorname{Li}_n(z)+\frac1{(n-1)!}\sum_{m=0}^{n-1}k_m\binom{n-1}{m}(2\pi i)^{m+1}(\log z)^{n-m-1}$$
which can be used to visualize the Riemann surface of the dilogarithm:
With[{ε = 1*^-12},
GraphicsRow[{ParametricPlot3D[Flatten[Table[{r Cos[φ], r Sin[φ],
...
6
Often these graphics commands are a bit obscure and one has to try. Is the following approx. what you are looking for?:
ListPlot[{{2, 5, 2, 8, 6, 8, 3}, {1, 2, 5, 2, 3, 4, 3}},
PlotMarkers -> {"\[SixPointedStar]", 15}, Joined -> True,
PlotStyle -> {Orange, Green},
PlotLegends ->
Placed[LineLegend[{"line1", "line2&...
5
sol = ParametricNDSolve[{D[x[t], t] == -y[t] +
x[t] (α - (x[t]^2 + y[t]^2)),
D[y[t], t] == x[t] + y[t] (α - (x[t]^2 + y[t]^2)),
x[0] == a, y[0] == b}, {x, y}, {t, 0, 10}, {a, b, α}];
{x0, y0} = {1, 1};
ParametricPlot3D[
Table[{x[x0, y0, α][t], α, y[x0, y0, α][t]} /.
sol, {α, -10, 10, 2}], {t, 0, 10},
AxesLabel -> {x, α, y}, ...
4
You might consider SliceVectorPlot3D with "BackPlanes" as the second argument:
e = {Cos[π x/5] Sin[π y / 4], Sin[π x / 5] Cos[π y/4], Sin[π x / 5] Sin[π y / 4]};
SliceVectorPlot3D[e, "BackPlanes", {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]
4
SeedRandom[1]
xy = RandomSample[Tuples[Range[0, 10], 2], 10];
z = RandomReal[1, 10];
xyz = Join[xy, List /@ z, 2]
{{9, 5, 0.941699}, {7, 3, 0.294264}, {1, 3, 0.188274}, {0, 0, 0.761529},
{6, 1, 0.169824}, {0, 3, 0.455359}, {5, 10, 0.75425}, {9, 1, 0.268291},
{2, 1, 0.147377}, {8, 9, 0.480659}}
Graphics
graphics = Graphics[{EdgeForm[Gray], Hue @ #3, ...
4
It is not possible to override the Quiet run of the command Plot. However, you can intercept the messages and store them in a list to be browsed afterwards.
For example,
errorlst = {};
Plot[if[t], {t, 0, 10},
EvaluationMonitor :>
If[Length[$MessageList] > 0,
AppendTo[errorlst, {$MessageList[[-1]], t}]]
]
To get the error messages later on, do:...
4
This system can be solved exactly using DSolve.
Clear["Global`*"]
$Version
(* "12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)" *)
Use exact values for the known parameters,
B = 2/5; C2 = 1/2; F = 3/5;
eqns = {y''[x] + A*y'[x] + B*y[x] + C2*y[x] == 0,
y[1] == 1, y'[0] == -1/5};
sol = DSolve[eqns, y, x];
Verifying the ...
4
Use arbitrary-precision rather than machine precision by specifying the WorkingPrecision.
Clear["Global`*"]
$Version
(* "12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)" *)
ComplexPlot3D[Sin[z]/MittagLefflerE[10, z], {z, -1 - I, 8 + I},
Exclusions -> None, PlotPoints -> 50, WorkingPrecision -> 15]
4
A cheap way to get what you want is to use Lighter[] along with "RedBlueTones" and an appropriate bell-shaped curve:
LinearGradientImage[Function[x, Lighter[ColorData["RedBlueTones", x],
Sech[5 (x - 1/2)]]], {300, 30}]
ContourPlot[x y, {x, -1, 1}, {y, -1, 1},
ColorFunction -> (...
answered Feb 23 at 20:14
4
Start from here:
σ = 1;
λ = 1/2;
ν = 1;
s1 = θ Cot[θ] + I ν θ;
eqn = σ + (λ s1);
ParametricPlot[{Re[eqn], Im[eqn]}, {θ, -3.5, 3.5}, AspectRatio -> 1]
3
For establishing the truth of the inequality over the entire region,
Refine[Abs[x/(1 + x)] - y/(1 + y) <= Abs[x - y]/(1 + 1/100 Abs[x - y]),
0 < x < 1 && 0 < y < 1]
(* True *)
For plotting the same,
RegionPlot[Abs[x/(1 + x)] - y/(1 + y) <= Abs[x - y]/(1 + 0.01 Abs[x - y]),
{x, 0, 1}, {y, 0, 1}]
3
You have a number of problems in your code.
Mathematica reserves uppercase N and O, you can't reassign them (well, at least not easily). You don't really need them.
Your code doesn't define 3 plots, so the Show can't show 3 curves.
That said you can avoid the Show completely.
Also, you've used Insert instead of Inset in the Epilog assignments.
c = 2.998 10^...
3
ClearAll[addHatchFilling]
addHatchFilling[meshfunctions_: Automatic, meshstyle_: Automatic,
mesh_: Automatic, meshshading_: Automatic] :=
ReplaceAll[p_Polygon :> {p,
First[RegionPlot[DiscretizeRegion[p],
MeshFunctions -> (meshfunctions /. Automatic -> {# + #2 &}),
MeshStyle -> (meshstyle /. Automatic -> Directive[...
3
1. You can construct your own ticks using FindDivisions:
fd = FindDivisions[{0, 70}, {7, 6}];
majorticks = Thread[{fd[[1]], 1945 + fd[[1]], {.025, .0}}, List, 2];
minorticks = Thread[{Flatten[Complement[#, First@fd] & /@ Last[fd]],
Spacer[0], {.015, 0}}, List, 1];
Plot[123456789 Exp[Log[163123123/123456789]/9 x], {x, -2, 69},
Frame -> True,
...
3
Here is an example with Overlay[]:
Manipulate[
With[{a =
If[m2 > m1 (\[Mu] Cos[\[Theta]] + Sin[\[Theta]]), (
9.8 (m2 - \[Mu] m1 Cos[\[Theta]] - m1 Sin[\[Theta]]))/(
m1 + m2), (
9.8 (m2 + \[Mu] m1 Cos[\[Theta]] - m1 Sin[\[Theta]]))/(m1 + m2)],
T = If[m2 > m1 (\[Mu] Cos[\[Theta]] + Sin[\[Theta]]), (
9.8 m1 m2 (1 + \[Mu] Cos[\...
3
Here's an approach that is a little non-precise mathematically but maybe more aesthetic:
sol = NDSolve[{
x'[t] == -y[t] + x[t] (α[t] - (x[t]^2 + y[t]^2)),
y'[t] == x[t] + y[t] (α[t] - (x[t]^2 + y[t]^2)),
α'[t] == -0.1,
x[-50] == 1, y[-50] == 1, α[-50] == 25}, {x, y, α}, {t, 0, 400}][[1]];
ParametricPlot3D[{α[t], x[t], y[t]} /. sol, {t, 0, 400}, ...
3
This should show you how to do it.
Manipulate[
If[x, Plot[Sin[2 π t], {t, 0, 1}], 0],
{x, {True, False}, Setter}]
Or, perhaps, this will be closer to the answer you are looking for:
With[{x = True}, If[x, Print[Plot[Sin[2 π t], {t, 0, 1}]], 0]]
The above will will show your plot, and this will return zero.
With[{x = False}, If[x, Print[Plot[Sin[2 π t], ...
2
I'd like to refer to the Maple documentation on this topic. I think so does Mathematica. Also consider the Riemann surface for PolyLog[2, z].
2
The axes are scaled to the data. If only want to change the axes with the same data you may use PlotRange:
ListLogLogPlot[Range[20]^3, Frame -> True,
FrameTicks -> {{PowerTicks[True],
PowerTicks[False]}, {PowerTicks[True], PowerTicks[False]}},
PlotRange -> {{10^-5, 10^5}, {10^-5, 10^5}}]
However, MMA does this automatically if the data ...
2
I'm late into this, but
plot = Plot[..., PlotLegends -> {...}]
Export["file.pdf", plot]
works fine for me in v12. (C.E.'s answer of Save selection as... puts an "Out[#]" on the side). So exporting to a PDF file could be a solution if one does not want to rasterize.
2
Have a look for example at a tutorial for what is behind the question: Ternary Contour. So this works not on functions but on numerical data series from tables. Like in this demonstration composition of vapor and liquid phases for a ternary ideal mixture this is then intepreted as function of values, for example an interpolation function, over the ...
2
Here is your corrected code, try to understand it. Note that the zeros are mostly real. And if they are complex, the imaginary part is very small. Maybe you want to change the parameters?
Manipulate[
zeros = NSolve[{6 \[Alpha] (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[
z]) + (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[z])^3 ==
0 && ...
2
Piecewise is the usual go-to for this sort of plotting:
f1[x_] := Piecewise[{
{x^2, x > 0},
{-50, x <= -2}
}
]
Plot[
f1[x],
{x, -10, 10},
Exclusions -> None
]
EDIT:
Also, if you were really dead set on using If, you would have to nest multiple If statements like this:
Plot[
If[x <= -2, -50, If[x > 0, x^2, 0]],
{x, -10, 10},...
2
Plot works with logical statements, for instance
Plot[If[x>0,x^2,0],{x,-10,10}]
Also see Piecewise or Switch instead of nesting Ifs for multiply defined functions.
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
plotting × 12504graphics × 1445
graphics3d × 683
differential-equations × 672
color × 573
list-manipulation × 524
manipulate × 506
legending × 503
equation-solving × 408
labeling × 341
functions × 302
calculus-and-analysis × 286
regions × 281
bugs × 255
parametric-functions × 238
visualization × 225
numerical-integration × 223
complex × 218
ticks × 210
export × 204
logarithmic-scale × 182
animation × 178
charts × 156
probability-or-statistics × 155
interpolation × 153