2
$\begingroup$

In this code, how can I have a different plot marker (say, diamond) for the plot marked by $g$? And how can I choose my favorite color for both plots $f$ and $g$?

{data1, data2} = 
  Transpose[
   Table[{n^2 π^3, n π Cos[1/(n^2 π^3)]}, {n, 50}]];
a = ListLogPlot[{data1, data2}, PlotLegends -> {"f", "g"}, 
  AxesLabel -> {"n", ""}]

enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

1.

ListLogPlot[{data1, data2}, PlotLegends -> {"f", "g"}, 
 AxesLabel -> {"n", ""}, 
 PlotMarkers -> {Style["\[FilledSquare]", 10, Blue], 
   Style["\[FilledUpTriangle]", 16, Red]}]

enter image description here

2.

ListLogPlot[{data1, data2}, PlotLegends -> {"f", "g"}, 
 AxesLabel -> {"n", ""}, 
 PlotMarkers -> {{Style["\[FilledSquare]", Blue], 10}, 
    {Style["\[FilledUpTriangle]",  Red], 16}}]

enter image description here

3.

ListLogPlot[{data1, data2}, PlotLegends -> {"f", "g"}, 
 AxesLabel -> {"n", ""}, PlotStyle -> {Blue, Red}, 
 PlotMarkers -> {{"\[FilledSquare]", 10}, 
    {"\[FilledUpTriangle]", 16}}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you very much. I am sorry, but I have another question. How can we ask to start the $n$ axis from $1$, not $0$? $\endgroup$
    – charmin
    Commented Nov 2, 2020 at 22:51
  • $\begingroup$ @charmin, add the option PlotRange -> {{1, All}, All}. $\endgroup$
    – kglr
    Commented Nov 2, 2020 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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