Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Simplify some table markup #24756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 21, 2022
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Dec 17, 2022

PR Summary

Our style guide is only against csv-table, but in these cases, there's no need to use a full grid table when a simple table works. Though in one case, I did replace with a definition list.

I also replaced ASCII art "tables" with Unicode block characters. That commit also fixes some messed up display due to incorrect code blocks.

PR Checklist

Documentation and Tests

  • [n/a] Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [n/a] New plotting related features are documented with examples.

Release Notes

  • [n/a] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [n/a] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [n/a] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@QuLogic QuLogic added this to the v3.7.0 milestone Dec 17, 2022
A path-like object which is a path to a style file.
list
A list of style specifiers (str, Path or dict) applied from first
to last in the list.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should one use this for the use docstring as well?

Copy link
Member

@oscargus oscargus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Only a single comment that should be quite easy to fix, but also can be postponed.

+-----+
| |
+-----+
┌─────┐
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of like identifying the corners in some way. Are you able to change it to *---* or some other identifier to get a distinct point at the corner? Right now this is just a box in the render and somewhat hard to identify exactly what the quantity in the parentheses is referring to.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this one and the other one is this file should as they were.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It doesn't look like there are any characters with a diagonal and a box corner. I tried using a diagonal off the corner

                (X[i+1, j], Y[i+1, j])         (X[i+1, j+1], Y[i+1, j+1])
                                      ╲       ╱
                                       ┌─────┐
                                       │     │
                                       └─────┘
                                      ╱       ╲
                    (X[i, j], Y[i, j])         (X[i, j+1], Y[i, j+1])

or an arrow pointing to it

                (X[i+1, j], Y[i+1, j])         (X[i+1, j+1], Y[i+1, j+1])
                                      ↘       ↙
                                       ┌─────┐
                                       │     │
                                       └─────┘
                                      ↗       ↖
                    (X[i, j], Y[i, j])         (X[i, j+1], Y[i, j+1])

but I don't really like them. Also tried a dot:

                (X[i+1, j], Y[i+1, j])       (X[i+1, j+1], Y[i+1, j+1])
                                      ●─────●
                                      │     │
                                      ●─────●
                    (X[i, j], Y[i, j])       (X[i, j+1], Y[i, j+1])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of like the third one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like the circles. It could be a bit confusing with the connected bars at the top but not the vertical making me think I'm perhaps missing something, but not a major issue either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunately due to the rectangular nature of the monospace characters with the circle being vertically centred, so not much can be done there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless, is there maybe a half horizontal line character so that we can stop the line early?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, there is such a thing:

                (X[i+1, j], Y[i+1, j])       (X[i+1, j+1], Y[i+1, j+1])
                                      ●╶───╴●
                                      │     │
                                      ●╶───╴●
                    (X[i, j], Y[i, j])       (X[i, j+1], Y[i, j+1])

These are not so complicated that they can't use simple tables, though
in one case, I thought a definition list looked better.
This also fixes some broken diagrams due to incorrect code block setup.
Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good like this to me!

@greglucas greglucas merged commit a668754 into matplotlib:main Dec 21, 2022
@QuLogic QuLogic deleted the simpler-tables branch December 21, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants