1
$\begingroup$

I use the following code to plot my graphic. I want to increase the size of the point in my legend. When I used LabelStyle, it increase only the text and not the point in the legend. How can I increase the point of my legend with the text ?

Needs["ErrorBarPlots`"]
func2[file_String /; FileExistsQ[file], colors_] := 
  Module[{data, formatted}, 
 formatted = {{#1, #2}, ErrorBar[#4, #3]} & @@@ data;
   ErrorListPlot[{formatted}, Joined -> False, 
    PlotLegends -> LineLegend[{FileBaseName[file]}], 
    PlotStyle -> {Directive[colors, PointSize[0.01]]}, , 
    LabelStyle -> {FontSize -> 34}]];
$\endgroup$
  • 1
    $\begingroup$ The function alone is not very helpful without example data. Moreover, please focus on the necessary details for answering the question. For example, everything involving file import it irrelevant. $\endgroup$ – Henrik Schumacher Jun 18 '18 at 11:57
  • $\begingroup$ You are probably looking for LegendMarkerSize. $\endgroup$ – Henrik Schumacher Jun 18 '18 at 12:00
  • $\begingroup$ I use Needs["ErrorBarPlots"]` and tried LgendMarkerSize but I get the following output OptionValue::nodef: Unknown option LegendMarkerSize for ErrorListPlot. $\endgroup$ – Bigprophete Jun 18 '18 at 12:09
  • $\begingroup$ @Bigprophete, try adapting LineLegend[{Red, Blue}, {Style["label 1", 16], Style["label 2", 24]}, LegendMarkers -> {"\[FilledCircle]", 20}, LegendMarkerSize -> 50] to your case. $\endgroup$ – kglr Jun 18 '18 at 12:16
4
$\begingroup$

A request: we have seen the code you posted in almost all of your questions so far. Please use fake data like the one used below (instead of files that we cannot access) to give minimal examples of the problem you are facing and the desired result.

The relevant part of the question can be solved using the LegendMarkers option inside LineLegend:

LineLegend[{Red, Blue}, {Style["label 1", 12], Style["label 2", 24]}, 
 LegendMarkers -> {"\[FilledCircle]", 20}, LegendMarkerSize -> 50]

enter image description here

Combined with made-up data for the irrelevant parts:

Needs["ErrorBarPlots`"]
SeedRandom[1]
data = RandomReal[100, {20, 4}];
formatted = {{#1, #2}, ErrorBar[#4/10, #3/10]} & @@@ data;
colors = Red;

ErrorListPlot[{formatted}, Joined -> False, 
 PlotLegends -> LineLegend[{Style["label 1", 24]}, 
   LegendMarkers -> {"\[FilledCircle]", 20}, LegendMarkerSize -> 50], 
 PlotStyle -> Directive[colors, PointSize[0.03]], 
 LabelStyle -> {FontSize -> 34}]

enter image description here

$\endgroup$
  • $\begingroup$ I see. Ok, sorry... I will try to put example and files next time. $\endgroup$ – Bigprophete Jun 18 '18 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.