Is this a bug in plotting step functions?Using FindFit for step functionsPlot3D Not Showing plotPlot failing over set domain with any functionsPlotting issue — possible bug?How to fill in missing points on a graph?Individually labeling plots generated by MapSciDraw doesnt plot full function over desired domain?Mathematica 11.0 3D plotting bug?Epilog and Prolog not ploting for small PlotRangePlotting step functions with filling option
Return a String containing only alphabets without spaces
Origin of "boor"
Which languages would be most useful in Europe at the end of the 19th century?
Are polynomials with the same roots identical?
How can I deal with uncomfortable silence from my partner?
Is it possible to fly backward if you have really strong headwind?
Scientist couple raises alien baby
Is this a bug in plotting step functions?
Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?
What does 思ってやっている mean?
If there's something that implicates the president why is there then a national security issue? (John Dowd)
Fermat's statement about the ancients: How serious was he?
Why does ''cat "$1:-/dev/stdin | ... &>/dev/null'' work in bash but not dash?
Is it possible to have 2 different but equal size real number sets that have the same mean and standard deviation?
How to “listen” to existing circuit
What is exactly Avijja -- and how to uproot it?
Are inverted question and exclamation mark supposed to be symmetrical to the "normal" counter-parts?
Getting UPS Power from One Room to Another
PDF vs. PNG figure: why does figure load so much faster even if file sizes are the same?
Live action TV show where High school Kids go into the virtual world and have to clear levels
Why did Intel abandon unified CPU cache?
How creative should the DM let an artificer be in terms of what they can build?
Printing Pascal’s triangle for n number of rows in Python
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
Is this a bug in plotting step functions?
Using FindFit for step functionsPlot3D Not Showing plotPlot failing over set domain with any functionsPlotting issue — possible bug?How to fill in missing points on a graph?Individually labeling plots generated by MapSciDraw doesnt plot full function over desired domain?Mathematica 11.0 3D plotting bug?Epilog and Prolog not ploting for small PlotRangePlotting step functions with filling option
$begingroup$
The following simple code generates a flawed plot:
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None]

I never expected part of the connection is slanted. Although I can fix this issue in many ways (such as using PlotPoints option, changing the plot ranges), this behavior is still surprising to me. Could anyone explain this?
(I'm using Mathematica 11.3)
plotting
$endgroup$
add a comment |
$begingroup$
The following simple code generates a flawed plot:
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None]

I never expected part of the connection is slanted. Although I can fix this issue in many ways (such as using PlotPoints option, changing the plot ranges), this behavior is still surprising to me. Could anyone explain this?
(I'm using Mathematica 11.3)
plotting
$endgroup$
1
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago
add a comment |
$begingroup$
The following simple code generates a flawed plot:
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None]

I never expected part of the connection is slanted. Although I can fix this issue in many ways (such as using PlotPoints option, changing the plot ranges), this behavior is still surprising to me. Could anyone explain this?
(I'm using Mathematica 11.3)
plotting
$endgroup$
The following simple code generates a flawed plot:
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None]

I never expected part of the connection is slanted. Although I can fix this issue in many ways (such as using PlotPoints option, changing the plot ranges), this behavior is still surprising to me. Could anyone explain this?
(I'm using Mathematica 11.3)
plotting
plotting
edited 7 hours ago
MassDefect
3,152314
3,152314
asked 8 hours ago
newOwennewOwen
563
563
1
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago
add a comment |
1
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago
1
1
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Add the option PlotPoints with a large value:
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
PlotPoints -> 200]

Alternatively,
Quiet @ Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
Method -> "MaxBend" -> 0]
same picture
$endgroup$
add a comment |
$begingroup$
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Adding Exclusions will cause Plot to look closely in the region of the Exclusions and result in clean steps.
Plot[f[t], t, 0, 16,
Exclusions -> 14.1, 14.5, 14.9,
Filling -> Axis]

EDIT: You will get the same result with Exclusions -> True. END EDIT
Or use the option MaxRecursion
Plot[f[t], t, 0, 16,
MaxRecursion -> 10,
Filling -> Axis]

$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199942%2fis-this-a-bug-in-plotting-step-functions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Add the option PlotPoints with a large value:
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
PlotPoints -> 200]

Alternatively,
Quiet @ Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
Method -> "MaxBend" -> 0]
same picture
$endgroup$
add a comment |
$begingroup$
Add the option PlotPoints with a large value:
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
PlotPoints -> 200]

Alternatively,
Quiet @ Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
Method -> "MaxBend" -> 0]
same picture
$endgroup$
add a comment |
$begingroup$
Add the option PlotPoints with a large value:
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
PlotPoints -> 200]

Alternatively,
Quiet @ Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
Method -> "MaxBend" -> 0]
same picture
$endgroup$
Add the option PlotPoints with a large value:
Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
PlotPoints -> 200]

Alternatively,
Quiet @ Plot[f[t], t, 0, 16, Filling -> Axis, Exclusions -> None,
Method -> "MaxBend" -> 0]
same picture
edited 7 hours ago
answered 8 hours ago
kglrkglr
197k10220442
197k10220442
add a comment |
add a comment |
$begingroup$
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Adding Exclusions will cause Plot to look closely in the region of the Exclusions and result in clean steps.
Plot[f[t], t, 0, 16,
Exclusions -> 14.1, 14.5, 14.9,
Filling -> Axis]

EDIT: You will get the same result with Exclusions -> True. END EDIT
Or use the option MaxRecursion
Plot[f[t], t, 0, 16,
MaxRecursion -> 10,
Filling -> Axis]

$endgroup$
add a comment |
$begingroup$
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Adding Exclusions will cause Plot to look closely in the region of the Exclusions and result in clean steps.
Plot[f[t], t, 0, 16,
Exclusions -> 14.1, 14.5, 14.9,
Filling -> Axis]

EDIT: You will get the same result with Exclusions -> True. END EDIT
Or use the option MaxRecursion
Plot[f[t], t, 0, 16,
MaxRecursion -> 10,
Filling -> Axis]

$endgroup$
add a comment |
$begingroup$
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Adding Exclusions will cause Plot to look closely in the region of the Exclusions and result in clean steps.
Plot[f[t], t, 0, 16,
Exclusions -> 14.1, 14.5, 14.9,
Filling -> Axis]

EDIT: You will get the same result with Exclusions -> True. END EDIT
Or use the option MaxRecursion
Plot[f[t], t, 0, 16,
MaxRecursion -> 10,
Filling -> Axis]

$endgroup$
f[t_] := UnitStep[t - 14.1] + UnitStep[t - 14.5] + UnitStep[t - 14.9]
Adding Exclusions will cause Plot to look closely in the region of the Exclusions and result in clean steps.
Plot[f[t], t, 0, 16,
Exclusions -> 14.1, 14.5, 14.9,
Filling -> Axis]

EDIT: You will get the same result with Exclusions -> True. END EDIT
Or use the option MaxRecursion
Plot[f[t], t, 0, 16,
MaxRecursion -> 10,
Filling -> Axis]

edited 4 hours ago
answered 5 hours ago
Bob HanlonBob Hanlon
63k33599
63k33599
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199942%2fis-this-a-bug-in-plotting-step-functions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
Please try to avoid using the bugs tag unless it has been confirmed as a bug by Wolfram or the community agrees that this is a bug.
$endgroup$
– MassDefect
7 hours ago