Filling only parts of a ListLinePlotListLinePlot partial fillingDisplay position information out of ListPlots inside a ManipulateCustom formatting for DateListPlotFilling Fill incomplete in ListLinePlotFilling only part of a plotListLinePlot problemHatched filling for ListLinePlotListLinePlot partial fillingListLinePlot Filling WrongHow to plot two y axis? or combine(merge) two plots? Should handle faceted column as wellFilling option generates extra PlotMarkers in ListLinePlot
Prints each letter of a string in different colors. C#
Is it a good idea to teach algorithm courses using pseudocode?
Does a windmilling propeller create more drag than a stopped propeller in an engine out scenario
What would be the game balance implications for using the Gygax method for applying falling damage?
Can I pay my credit card?
How to pipe results multiple results into a command?
Lock out of Oracle based on Windows username
Should I twist DC power and ground wires from a power supply?
Is it standard to have the first week's pay indefinitely withheld?
Bookshelves: the intruder
What's is the easiest way to purchase a stock and hold it
Why didn't Daenerys' advisers suggest assassinating Cersei?
What technology would Dwarves need to forge titanium?
How was the blinking terminal cursor invented?
Alternative classical explanation of the Stern-Gerlach Experiment?
Cathy’s Composite party is powered by three Prime Pals. Can you find them?
Divisor Rich and Poor Numbers
Why are there five extra turns in tournament Magic?
Are there any symmetric cryptosystems based on computational complexity assumptions?
Does the usage of mathematical symbols work differently in books than in theses?
How does this piece of code determine array size without using sizeof( )?
Why are stats in Angband written as 18/** instead of 19, 20...?
Have GoT's showrunners reacted to the poor reception of the final season?
Is there a language that let's you use a try block without a catch block?
Filling only parts of a ListLinePlot
ListLinePlot partial fillingDisplay position information out of ListPlots inside a ManipulateCustom formatting for DateListPlotFilling Fill incomplete in ListLinePlotFilling only part of a plotListLinePlot problemHatched filling for ListLinePlotListLinePlot partial fillingListLinePlot Filling WrongHow to plot two y axis? or combine(merge) two plots? Should handle faceted column as wellFilling option generates extra PlotMarkers in ListLinePlot
$begingroup$
I have a set of x,y data that shows a measurement value over time on the x axis. I'd like to highlight several chunks of time on my ListLinePlot by filling the plot to the axis for only certain x-ranges (say, 10-20 and 55-96).
I've tried the methods outlined here: ListLinePlot partial filling
data1 = movavgjoined; data1[[;; 9]] = Null; data1[[21 ;;]] = Null;
ListLinePlot[movavgjoined, data1, Filling -> 2 -> Axis]
But the output is just the original graph.
Edit: here's some sample data
movavgjoined = 0.00416667,5.50648,0.00833333,5.51119,0.0125,5.51531,
0.0166667,5.51983,0.0208333,5.52381,0.025,5.52728,0.0291667,5.53126,
0.0333333,5.53551,0.0375,5.53966,0.0416667,5.54449,0.0458333,5.54942,
0.05,5.55455,0.0541667,5.55929,0.0583333,5.56368,0.0625,5.56793,
0.0666667,5.57214,0.0708333,5.57568,0.075,5.57774,0.0791667,5.57921,
0.0833333,5.58106,0.0875,5.58391,0.0916667,5.5875,0.0958333,5.59185,
0.1,5.59556,0.104167,5.59932,0.108333,5.60445,0.1125,5.61067,
0.116667,5.61925,0.120833,5.62737,0.125,5.63508,0.129167,5.64551,
0.133333,5.65654,0.1375,5.665,0.141667,5.67078,0.145833,5.67456,
0.15,5.67668,0.154167,5.67757,0.158333,5.67719,0.1625,5.67757,
0.166667,5.68031;
plotting filling
$endgroup$
add a comment |
$begingroup$
I have a set of x,y data that shows a measurement value over time on the x axis. I'd like to highlight several chunks of time on my ListLinePlot by filling the plot to the axis for only certain x-ranges (say, 10-20 and 55-96).
I've tried the methods outlined here: ListLinePlot partial filling
data1 = movavgjoined; data1[[;; 9]] = Null; data1[[21 ;;]] = Null;
ListLinePlot[movavgjoined, data1, Filling -> 2 -> Axis]
But the output is just the original graph.
Edit: here's some sample data
movavgjoined = 0.00416667,5.50648,0.00833333,5.51119,0.0125,5.51531,
0.0166667,5.51983,0.0208333,5.52381,0.025,5.52728,0.0291667,5.53126,
0.0333333,5.53551,0.0375,5.53966,0.0416667,5.54449,0.0458333,5.54942,
0.05,5.55455,0.0541667,5.55929,0.0583333,5.56368,0.0625,5.56793,
0.0666667,5.57214,0.0708333,5.57568,0.075,5.57774,0.0791667,5.57921,
0.0833333,5.58106,0.0875,5.58391,0.0916667,5.5875,0.0958333,5.59185,
0.1,5.59556,0.104167,5.59932,0.108333,5.60445,0.1125,5.61067,
0.116667,5.61925,0.120833,5.62737,0.125,5.63508,0.129167,5.64551,
0.133333,5.65654,0.1375,5.665,0.141667,5.67078,0.145833,5.67456,
0.15,5.67668,0.154167,5.67757,0.158333,5.67719,0.1625,5.67757,
0.166667,5.68031;
plotting filling
$endgroup$
add a comment |
$begingroup$
I have a set of x,y data that shows a measurement value over time on the x axis. I'd like to highlight several chunks of time on my ListLinePlot by filling the plot to the axis for only certain x-ranges (say, 10-20 and 55-96).
I've tried the methods outlined here: ListLinePlot partial filling
data1 = movavgjoined; data1[[;; 9]] = Null; data1[[21 ;;]] = Null;
ListLinePlot[movavgjoined, data1, Filling -> 2 -> Axis]
But the output is just the original graph.
Edit: here's some sample data
movavgjoined = 0.00416667,5.50648,0.00833333,5.51119,0.0125,5.51531,
0.0166667,5.51983,0.0208333,5.52381,0.025,5.52728,0.0291667,5.53126,
0.0333333,5.53551,0.0375,5.53966,0.0416667,5.54449,0.0458333,5.54942,
0.05,5.55455,0.0541667,5.55929,0.0583333,5.56368,0.0625,5.56793,
0.0666667,5.57214,0.0708333,5.57568,0.075,5.57774,0.0791667,5.57921,
0.0833333,5.58106,0.0875,5.58391,0.0916667,5.5875,0.0958333,5.59185,
0.1,5.59556,0.104167,5.59932,0.108333,5.60445,0.1125,5.61067,
0.116667,5.61925,0.120833,5.62737,0.125,5.63508,0.129167,5.64551,
0.133333,5.65654,0.1375,5.665,0.141667,5.67078,0.145833,5.67456,
0.15,5.67668,0.154167,5.67757,0.158333,5.67719,0.1625,5.67757,
0.166667,5.68031;
plotting filling
$endgroup$
I have a set of x,y data that shows a measurement value over time on the x axis. I'd like to highlight several chunks of time on my ListLinePlot by filling the plot to the axis for only certain x-ranges (say, 10-20 and 55-96).
I've tried the methods outlined here: ListLinePlot partial filling
data1 = movavgjoined; data1[[;; 9]] = Null; data1[[21 ;;]] = Null;
ListLinePlot[movavgjoined, data1, Filling -> 2 -> Axis]
But the output is just the original graph.
Edit: here's some sample data
movavgjoined = 0.00416667,5.50648,0.00833333,5.51119,0.0125,5.51531,
0.0166667,5.51983,0.0208333,5.52381,0.025,5.52728,0.0291667,5.53126,
0.0333333,5.53551,0.0375,5.53966,0.0416667,5.54449,0.0458333,5.54942,
0.05,5.55455,0.0541667,5.55929,0.0583333,5.56368,0.0625,5.56793,
0.0666667,5.57214,0.0708333,5.57568,0.075,5.57774,0.0791667,5.57921,
0.0833333,5.58106,0.0875,5.58391,0.0916667,5.5875,0.0958333,5.59185,
0.1,5.59556,0.104167,5.59932,0.108333,5.60445,0.1125,5.61067,
0.116667,5.61925,0.120833,5.62737,0.125,5.63508,0.129167,5.64551,
0.133333,5.65654,0.1375,5.665,0.141667,5.67078,0.145833,5.67456,
0.15,5.67668,0.154167,5.67757,0.158333,5.67719,0.1625,5.67757,
0.166667,5.68031;
plotting filling
plotting filling
edited May 6 at 7:23
user63997
asked May 6 at 3:33
user63997user63997
283
283
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
yintervals = 5.55, 5.58, 5.61, 5.66;
data2 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ yintervals), #[[2]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data2, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
xintervals = .05, .08, .11, .13;
data3 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ xintervals), #[[1]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data3, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
$endgroup$
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post yourmovavgjoined
.
$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
|
show 2 more comments
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%2f197782%2ffilling-only-parts-of-a-listlineplot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
yintervals = 5.55, 5.58, 5.61, 5.66;
data2 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ yintervals), #[[2]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data2, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
xintervals = .05, .08, .11, .13;
data3 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ xintervals), #[[1]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data3, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
$endgroup$
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post yourmovavgjoined
.
$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
|
show 2 more comments
$begingroup$
yintervals = 5.55, 5.58, 5.61, 5.66;
data2 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ yintervals), #[[2]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data2, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
xintervals = .05, .08, .11, .13;
data3 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ xintervals), #[[1]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data3, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
$endgroup$
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post yourmovavgjoined
.
$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
|
show 2 more comments
$begingroup$
yintervals = 5.55, 5.58, 5.61, 5.66;
data2 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ yintervals), #[[2]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data2, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
xintervals = .05, .08, .11, .13;
data3 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ xintervals), #[[1]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data3, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
$endgroup$
yintervals = 5.55, 5.58, 5.61, 5.66;
data2 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ yintervals), #[[2]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data2, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
xintervals = .05, .08, .11, .13;
data3 = If[IntervalMemberQ[IntervalUnion @@ (Interval /@ xintervals), #[[1]]],
#, #[[1]], Null] & /@ movavgjoined;
ListLinePlot[movavgjoined, data3, Filling -> 2 -> Axis, PlotStyle -> ColorData[97][1]]
edited May 6 at 7:30
answered May 6 at 3:52
kglrkglr
192k10214434
192k10214434
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post yourmovavgjoined
.
$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
|
show 2 more comments
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post yourmovavgjoined
.
$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
Thank you for your suggestion! Okay so this is working but it's filling the wrong part of my plot. I think this is because these functions call the nth list element rather than as a range of y values. My y values are time values in minutes/fractions of minutes and are irregularly spaced. So the 10th-20th time point is being filled as opposed to 10 minutes-20 minutes.
$endgroup$
– user63997
May 6 at 4:34
$begingroup$
@user63997, it would be easier to suggest a solution if you can post your
movavgjoined
.$endgroup$
– kglr
May 6 at 4:37
$begingroup$
@user63997, it would be easier to suggest a solution if you can post your
movavgjoined
.$endgroup$
– kglr
May 6 at 4:37
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
True! I edited the original post with some sample data. It's a big list, so I just included the first few points so you get the idea.
$endgroup$
– user63997
May 6 at 4:53
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
Shoot, I see now that I made a mistake in my original post. The X axis is the time points, not the Y. So the above code uses a y-range which you've defined. The graph is exactly what I'm wanting, though. So say here instead of defining the y values, the time ranges on the x axis that I'd like to fill are 0.5, 0.8 and 0.11,0.13. Would the code be the same?
$endgroup$
– user63997
May 6 at 7:19
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
$begingroup$
@user63997, updated with the version that uses intervals of x-coordinates.
$endgroup$
– kglr
May 6 at 7:31
|
show 2 more comments
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%2f197782%2ffilling-only-parts-of-a-listlineplot%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