2
$\begingroup$

Using Solve, I have produced the following list of solutions to an equation:

pts = 
 {{a -> 6, b -> 3}, {a -> 7, b -> 3}, {a -> 9, b -> 4}, 
  {a -> 10, b -> 4}, {a -> 10, b -> 5}, {a -> 11, b -> 3}, 
  {a -> 11, b -> 5}, {a -> 12, b -> 3}, {a -> 12, b -> 4}, 
  {a -> 12, b -> 5}};

I would like to know how I can generate a plot of the points $(a, b)$ from the list.

$\endgroup$
2
  • 3
    $\begingroup$ ListPlot[{a, b} /. {{a -> 6, b -> 3}, {a -> 7, b -> 3}, {a -> 9, b -> 4}, {a -> 10, b -> 4}, {a -> 10, b -> 5}, {a -> 11, b -> 3}, {a -> 11, b -> 5}, {a -> 12, b -> 3}, {a -> 12, b -> 4}, {a -> 12, b -> 5}}, AxesOrigin -> {0, 0}] $\endgroup$
    – Artes
    Commented Feb 19, 2020 at 3:40
  • 1
    $\begingroup$ In addition, Values[pts]==pts[[All,All,2]] $\endgroup$
    – user1066
    Commented Feb 19, 2020 at 9:25

1 Answer 1

4
$\begingroup$

Besides using ReplaceAll (/.), one can also use Values to extract the data and plot it.

ListPlot[Values[pts]]
$\endgroup$

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.