Missing `xlim([0.5 5.5])` in the Second Subplot of Exercise 8.21 (Page 284)

Open Beginner friendly
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
documentation

Research direction

Start with the Exercise 8.21 code listing on page 284, specifically the second subplot containing swarmchart. Compare it with the prompt requiring both panels to use [0.5, 5.5] and the range shown in Figure 8.27. Done means the bottom panel's x-axis limits match the prompt and figure.

Written by the indexing model from the issue text.

Description

Dear Professors

While running the code for Exercise 8.21 on page 284, I noticed a small omission in the snippet used to generate Figure 8.27.

image

The exercise prompt explicitly states:

"Set the $x$-axis limits in both panels to [0.5, 5.5]."

However, in the code listing on page 284 (lines 4–10), xlim([0.5 5.5]) is only applied to the top subplot (scatter), and is missing from the bottom subplot (swarmchart):


    subplot(nr,nc,1)
    scatter(loyalty,'family','amount_spent')
    title('Scatter Plot')
    xlim([0.5 5.5])
    subplot(nr,nc,2)
    swarmchart(loyalty,'family','amount_spent')
    title('Swarm Chart')

As a result, running the snippet as written leaves the bottom panel with MATLAB's default x-axis limits (typically [0, 6]), rather than matching the [0.5, 5.5] range shown in Figure 8.27

Thanks always for the time!

Dominant language
MATLAB
Stars
30
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UniprJRC/DSwithMATLAB

All issues in UniprJRC/DSwithMATLAB

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.