4
$\begingroup$

Suppose I have to plot 7 function in a single plot, a toy example may be

Plot[Table[x^i, {i, 7}], {x, 0, 5}]

This gives me a plot including 7 blue lines, but I want to plot them so that every single curve can be distinguishable. There is PlotMarkers option for ListPlot which does this in a best way, I want such a equivalent here. Since I guess you suggest the following solutions I write my reason for not using them:

  • Using colors: I want to print my plots in black and white
  • Using Plot style: there are limited plot styles for for using: solid, dashed,dotted,dott-dashed which are not enough for showing 7 functions for example.
  • Calculating points using Table and then plotting them by ListPlot: The distribution of points of my functions are not suitable for doing this and the overall shape of function isn't identified clearly.
  • Using Thickness: Since there are many functions, thickness of curves are not distinguishable.

Any idea?

$\endgroup$
5
  • 2
    $\begingroup$ how about Plot[Evaluate@Table[x^i, {i, 7}], {x, 0, 5}, PlotTheme -> "Monochrome",PlotLegends->"Expressions"]? $\endgroup$
    – kglr
    Commented Apr 26, 2022 at 8:54
  • 1
    $\begingroup$ Why not use ListLinePlot and use PlotMarkers of your choice? $\endgroup$
    – Syed
    Commented Apr 26, 2022 at 8:54
  • 1
    $\begingroup$ Use the @kglr answer above with ScalingFunctions to reduce plot congestion: Plot[Evaluate@Table[x^i, {i, 7}], {x, 0, 5}, PlotTheme -> "Monochrome", PlotLegends -> LineLegend["Expressions", LegendLayout -> "ReversedColumn"] , ScalingFunctions -> {None, "Log"}] $\endgroup$
    – Syed
    Commented Apr 26, 2022 at 8:58
  • $\begingroup$ @kglr Great job! Please write it as an answer $\endgroup$
    – Wisdom
    Commented Apr 26, 2022 at 9:02
  • $\begingroup$ Have you considered using Callout ? $\endgroup$
    – LouisB
    Commented Apr 26, 2022 at 9:28

1 Answer 1

7
$\begingroup$
Plot[Evaluate @ Table[x^i, {i, 7}], {x, 0, 5},  
   PlotTheme -> "Monochrome", PlotLegends -> "Expressions"]

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Or to order the legends more like the plot: Plot[Evaluate@Table[x^i, {i, 7}], {x, 0, 5}, PlotTheme -> "Monochrome", PlotLegends -> LineLegend["Expressions", LegendLayout -> "ReversedColumn"], Frame -> True] $\endgroup$
    – Bob Hanlon
    Commented Apr 26, 2022 at 17:08

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.