How to remove lines through the legend markers in ListPlot?ErrorListPlot Legend with MarkersHow to keep...
Are there any modern advantages of a fire piston?
How long is the D&D Starter Set campaign?
Why do members of Congress in committee hearings ask witnesses the same question multiple times?
What is 6÷2×(1+2) =?
Why are the books in the Game of Thrones citadel library shelved spine inwards?
Why do stocks necessarily drop during a recession?
Can a hotel cancel a confirmed reservation?
Would a National Army of mercenaries be a feasible idea?
Can making a creature unable to attack after it has been assigned as an attacker remove it from combat?
It took me a lot of time to make this, pls like. (YouTube Comments #1)
How to deal with an incendiary email that was recalled
Am I a Rude Number?
How can animals be objects of ethics without being subjects as well?
Does SQL Server 2017, including older versions, support 8k disk sector sizes?
Explain the objections to these measures against human trafficking
Intern applicant asking for compensation equivalent to that of permanent employee
How to avoid being sexist when trying to employ someone to function in a very sexist environment?
Can I become debt free or should I file bankruptcy ? How to manage my debt and finances?
How to say "Brexit" in Latin?
How do Chazal know that the descendants of a Mamzer may never marry into the general populace?
How to prevent users from executing commands through browser URL
what does しにみえてる mean?
Caruana vs Carlsen game 10 (WCC) why not 18...Nxb6?
Early credit roll before the end of the film
How to remove lines through the legend markers in ListPlot?
ErrorListPlot Legend with MarkersHow to keep markers as dots in a joined ListPlot?Legends in a combined Plot and ListPlotPlotLegends in ListPlot does not display different markersWhen using ListPlot, if Joined->True and PlotMarkers -> {Automatic} then if PlotRange is smaller than the range of data, then I get mismatched markersHow to put a PlotLegends in this case?How to improve a color in a legend to customly-made markers?Unwanted frame around markers in legendLabels on 2D ListPlot MarkersLegend with matching lines
$begingroup$
I am drawing a plot with some legends. It seems the legend markers will always have lines through them since I have to use Joined->True
for this plot. The legend markers also seem to be always larger than those in the plot. My question is, is it possible to get rid of those lines through the legend markers and also make the legend markers smaller? Besides, is there a way to remove the grey outlines around the legend markers?
The code I used for this plot is
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9,
ScriptMinSize -> 6]}], {0.3, 0.8}], ImageSize -> 240]
plotting legending marker
$endgroup$
add a comment |
$begingroup$
I am drawing a plot with some legends. It seems the legend markers will always have lines through them since I have to use Joined->True
for this plot. The legend markers also seem to be always larger than those in the plot. My question is, is it possible to get rid of those lines through the legend markers and also make the legend markers smaller? Besides, is there a way to remove the grey outlines around the legend markers?
The code I used for this plot is
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9,
ScriptMinSize -> 6]}], {0.3, 0.8}], ImageSize -> 240]
plotting legending marker
$endgroup$
add a comment |
$begingroup$
I am drawing a plot with some legends. It seems the legend markers will always have lines through them since I have to use Joined->True
for this plot. The legend markers also seem to be always larger than those in the plot. My question is, is it possible to get rid of those lines through the legend markers and also make the legend markers smaller? Besides, is there a way to remove the grey outlines around the legend markers?
The code I used for this plot is
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9,
ScriptMinSize -> 6]}], {0.3, 0.8}], ImageSize -> 240]
plotting legending marker
$endgroup$
I am drawing a plot with some legends. It seems the legend markers will always have lines through them since I have to use Joined->True
for this plot. The legend markers also seem to be always larger than those in the plot. My question is, is it possible to get rid of those lines through the legend markers and also make the legend markers smaller? Besides, is there a way to remove the grey outlines around the legend markers?
The code I used for this plot is
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9,
ScriptMinSize -> 6]}], {0.3, 0.8}], ImageSize -> 240]
plotting legending marker
plotting legending marker
edited 4 hours ago
corey979
20.8k64282
20.8k64282
asked 5 hours ago
nanjunnanjun
32619
32619
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
This is just an answer for your last question. You can get rid of the border of your markers in the legend by specifying EdgeForm[None]
, e.g.:
ListPlot[
{{1,2,3,4,5}, (1/2) {1,2,3,4,5}},
Joined->True,
PlotStyle->{
{Blue,Dashed,AbsoluteThickness[1]},
{Red,Dashed,AbsoluteThickness[1]}
},
PlotMarkers->{
{Graphics@{EdgeForm[None],Disk[]},0.04},
{Graphics@{EdgeForm[None],Rectangle[]},0.04}
},
InterpolationOrder->1,
Frame->{{True,False},{True,False}},
PlotLegends->Placed[
PointLegend[
Automatic,
{
Style["Series 1",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6],
Style["Series 2",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6]
}
],
{0.3,0.8}
],
ImageSize->240
]
$endgroup$
add a comment |
$begingroup$
Here is a work around.
Show[ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {Blue, Red},
PlotMarkers -> {{Graphics@{EdgeForm[None], Disk[]},
0.04}, {Graphics@{EdgeForm[None], Rectangle[]}, 0.04}},
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[
PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6]}], {0.3, 0.8}],
ImageSize -> 240],
ListLinePlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}}]]
$endgroup$
add a comment |
$begingroup$
Just add the options Joined -> False
and BaseStyle -> EdgeForm[]
to PointLegend
in your code to get
If you don't like the red syntax highlighting of BaseStyle -> EdgeForm[]
you can use Method -> { BaseStyle -> EdgeForm[]}
.
$endgroup$
add a comment |
$begingroup$
Define a standalone legend
:
legend = PointLegend[{Red, Blue},
{Style["Series 1", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6]},
LegendMarkers -> {{Graphics@{EdgeForm[None], Disk[]}, 0.04},
{Graphics@{EdgeForm[None], Rectangle[]}, 0.04}}]
Unfortunately, adding PlotLegends -> Placed[legend, {0.3, 0.8}]
doesn't work:
plot2 = ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends -> Placed[legend, {0.3, 0.8}], ImageSize -> 240]
However, Legended
is a workaround:
plot3 = Legended[
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}}, ImageSize -> 240],
Placed[legend, {0.3, 0.8}]]
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
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%2f192392%2fhow-to-remove-lines-through-the-legend-markers-in-listplot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This is just an answer for your last question. You can get rid of the border of your markers in the legend by specifying EdgeForm[None]
, e.g.:
ListPlot[
{{1,2,3,4,5}, (1/2) {1,2,3,4,5}},
Joined->True,
PlotStyle->{
{Blue,Dashed,AbsoluteThickness[1]},
{Red,Dashed,AbsoluteThickness[1]}
},
PlotMarkers->{
{Graphics@{EdgeForm[None],Disk[]},0.04},
{Graphics@{EdgeForm[None],Rectangle[]},0.04}
},
InterpolationOrder->1,
Frame->{{True,False},{True,False}},
PlotLegends->Placed[
PointLegend[
Automatic,
{
Style["Series 1",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6],
Style["Series 2",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6]
}
],
{0.3,0.8}
],
ImageSize->240
]
$endgroup$
add a comment |
$begingroup$
This is just an answer for your last question. You can get rid of the border of your markers in the legend by specifying EdgeForm[None]
, e.g.:
ListPlot[
{{1,2,3,4,5}, (1/2) {1,2,3,4,5}},
Joined->True,
PlotStyle->{
{Blue,Dashed,AbsoluteThickness[1]},
{Red,Dashed,AbsoluteThickness[1]}
},
PlotMarkers->{
{Graphics@{EdgeForm[None],Disk[]},0.04},
{Graphics@{EdgeForm[None],Rectangle[]},0.04}
},
InterpolationOrder->1,
Frame->{{True,False},{True,False}},
PlotLegends->Placed[
PointLegend[
Automatic,
{
Style["Series 1",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6],
Style["Series 2",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6]
}
],
{0.3,0.8}
],
ImageSize->240
]
$endgroup$
add a comment |
$begingroup$
This is just an answer for your last question. You can get rid of the border of your markers in the legend by specifying EdgeForm[None]
, e.g.:
ListPlot[
{{1,2,3,4,5}, (1/2) {1,2,3,4,5}},
Joined->True,
PlotStyle->{
{Blue,Dashed,AbsoluteThickness[1]},
{Red,Dashed,AbsoluteThickness[1]}
},
PlotMarkers->{
{Graphics@{EdgeForm[None],Disk[]},0.04},
{Graphics@{EdgeForm[None],Rectangle[]},0.04}
},
InterpolationOrder->1,
Frame->{{True,False},{True,False}},
PlotLegends->Placed[
PointLegend[
Automatic,
{
Style["Series 1",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6],
Style["Series 2",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6]
}
],
{0.3,0.8}
],
ImageSize->240
]
$endgroup$
This is just an answer for your last question. You can get rid of the border of your markers in the legend by specifying EdgeForm[None]
, e.g.:
ListPlot[
{{1,2,3,4,5}, (1/2) {1,2,3,4,5}},
Joined->True,
PlotStyle->{
{Blue,Dashed,AbsoluteThickness[1]},
{Red,Dashed,AbsoluteThickness[1]}
},
PlotMarkers->{
{Graphics@{EdgeForm[None],Disk[]},0.04},
{Graphics@{EdgeForm[None],Rectangle[]},0.04}
},
InterpolationOrder->1,
Frame->{{True,False},{True,False}},
PlotLegends->Placed[
PointLegend[
Automatic,
{
Style["Series 1",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6],
Style["Series 2",FontFamily->"Times New Roman",FontSize->9,ScriptMinSize->6]
}
],
{0.3,0.8}
],
ImageSize->240
]
answered 4 hours ago
Carl WollCarl Woll
68.7k390176
68.7k390176
add a comment |
add a comment |
$begingroup$
Here is a work around.
Show[ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {Blue, Red},
PlotMarkers -> {{Graphics@{EdgeForm[None], Disk[]},
0.04}, {Graphics@{EdgeForm[None], Rectangle[]}, 0.04}},
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[
PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6]}], {0.3, 0.8}],
ImageSize -> 240],
ListLinePlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}}]]
$endgroup$
add a comment |
$begingroup$
Here is a work around.
Show[ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {Blue, Red},
PlotMarkers -> {{Graphics@{EdgeForm[None], Disk[]},
0.04}, {Graphics@{EdgeForm[None], Rectangle[]}, 0.04}},
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[
PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6]}], {0.3, 0.8}],
ImageSize -> 240],
ListLinePlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}}]]
$endgroup$
add a comment |
$begingroup$
Here is a work around.
Show[ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {Blue, Red},
PlotMarkers -> {{Graphics@{EdgeForm[None], Disk[]},
0.04}, {Graphics@{EdgeForm[None], Rectangle[]}, 0.04}},
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[
PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6]}], {0.3, 0.8}],
ImageSize -> 240],
ListLinePlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}}]]
$endgroup$
Here is a work around.
Show[ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {Blue, Red},
PlotMarkers -> {{Graphics@{EdgeForm[None], Disk[]},
0.04}, {Graphics@{EdgeForm[None], Rectangle[]}, 0.04}},
Frame -> {{True, False}, {True, False}},
PlotLegends ->
Placed[
PointLegend[
Automatic, {Style["Series 1", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman",
FontSize -> 9, ScriptMinSize -> 6]}], {0.3, 0.8}],
ImageSize -> 240],
ListLinePlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}}]]
answered 4 hours ago
Okkes DulgerciOkkes Dulgerci
5,0391917
5,0391917
add a comment |
add a comment |
$begingroup$
Just add the options Joined -> False
and BaseStyle -> EdgeForm[]
to PointLegend
in your code to get
If you don't like the red syntax highlighting of BaseStyle -> EdgeForm[]
you can use Method -> { BaseStyle -> EdgeForm[]}
.
$endgroup$
add a comment |
$begingroup$
Just add the options Joined -> False
and BaseStyle -> EdgeForm[]
to PointLegend
in your code to get
If you don't like the red syntax highlighting of BaseStyle -> EdgeForm[]
you can use Method -> { BaseStyle -> EdgeForm[]}
.
$endgroup$
add a comment |
$begingroup$
Just add the options Joined -> False
and BaseStyle -> EdgeForm[]
to PointLegend
in your code to get
If you don't like the red syntax highlighting of BaseStyle -> EdgeForm[]
you can use Method -> { BaseStyle -> EdgeForm[]}
.
$endgroup$
Just add the options Joined -> False
and BaseStyle -> EdgeForm[]
to PointLegend
in your code to get
If you don't like the red syntax highlighting of BaseStyle -> EdgeForm[]
you can use Method -> { BaseStyle -> EdgeForm[]}
.
answered 4 hours ago
kglrkglr
186k10203422
186k10203422
add a comment |
add a comment |
$begingroup$
Define a standalone legend
:
legend = PointLegend[{Red, Blue},
{Style["Series 1", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6]},
LegendMarkers -> {{Graphics@{EdgeForm[None], Disk[]}, 0.04},
{Graphics@{EdgeForm[None], Rectangle[]}, 0.04}}]
Unfortunately, adding PlotLegends -> Placed[legend, {0.3, 0.8}]
doesn't work:
plot2 = ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends -> Placed[legend, {0.3, 0.8}], ImageSize -> 240]
However, Legended
is a workaround:
plot3 = Legended[
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}}, ImageSize -> 240],
Placed[legend, {0.3, 0.8}]]
$endgroup$
add a comment |
$begingroup$
Define a standalone legend
:
legend = PointLegend[{Red, Blue},
{Style["Series 1", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6]},
LegendMarkers -> {{Graphics@{EdgeForm[None], Disk[]}, 0.04},
{Graphics@{EdgeForm[None], Rectangle[]}, 0.04}}]
Unfortunately, adding PlotLegends -> Placed[legend, {0.3, 0.8}]
doesn't work:
plot2 = ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends -> Placed[legend, {0.3, 0.8}], ImageSize -> 240]
However, Legended
is a workaround:
plot3 = Legended[
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}}, ImageSize -> 240],
Placed[legend, {0.3, 0.8}]]
$endgroup$
add a comment |
$begingroup$
Define a standalone legend
:
legend = PointLegend[{Red, Blue},
{Style["Series 1", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6]},
LegendMarkers -> {{Graphics@{EdgeForm[None], Disk[]}, 0.04},
{Graphics@{EdgeForm[None], Rectangle[]}, 0.04}}]
Unfortunately, adding PlotLegends -> Placed[legend, {0.3, 0.8}]
doesn't work:
plot2 = ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends -> Placed[legend, {0.3, 0.8}], ImageSize -> 240]
However, Legended
is a workaround:
plot3 = Legended[
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}}, ImageSize -> 240],
Placed[legend, {0.3, 0.8}]]
$endgroup$
Define a standalone legend
:
legend = PointLegend[{Red, Blue},
{Style["Series 1", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6],
Style["Series 2", FontFamily -> "Times New Roman", FontSize -> 9, ScriptMinSize -> 6]},
LegendMarkers -> {{Graphics@{EdgeForm[None], Disk[]}, 0.04},
{Graphics@{EdgeForm[None], Rectangle[]}, 0.04}}]
Unfortunately, adding PlotLegends -> Placed[legend, {0.3, 0.8}]
doesn't work:
plot2 = ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}},
Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}},
PlotLegends -> Placed[legend, {0.3, 0.8}], ImageSize -> 240]
However, Legended
is a workaround:
plot3 = Legended[
ListPlot[{{1, 2, 3, 4, 5}, (1/2) {1, 2, 3, 4, 5}}, Joined -> True,
PlotStyle -> {{Blue, Dashed, AbsoluteThickness[1]}, {Red, Dashed,
AbsoluteThickness[1]}},
PlotMarkers -> {{Graphics@{Disk[]}, 0.04}, {Graphics@{Rectangle[]},
0.04}}, InterpolationOrder -> 1,
Frame -> {{True, False}, {True, False}}, ImageSize -> 240],
Placed[legend, {0.3, 0.8}]]
answered 4 hours ago
corey979corey979
20.8k64282
20.8k64282
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%2f192392%2fhow-to-remove-lines-through-the-legend-markers-in-listplot%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