-
Notifications
You must be signed in to change notification settings - Fork 7
Blog - overview #26
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
base: gh-pages
Are you sure you want to change the base?
Blog - overview #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's mostly solid, like that it's very small but still illustrative. Only change I think it really needs is the tiny shared data so that the examples are runnable.
_posts/plotting-overview.md
Outdated
excerpt_separator: <!--read more--> | ||
--- | ||
## Altair | ||
Altair uses a declarative grammar. As its [overview](https://altair-viz.github.io/getting_started/overview.html) states: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs slightly more context. Something like: Altair is a Python visualization library built on top of the Vega/Vegalite declarative grammar.
_posts/plotting-overview.md
Outdated
--- | ||
## Altair | ||
Altair uses a declarative grammar. As its [overview](https://altair-viz.github.io/getting_started/overview.html) states: | ||
>The key idea is that you are declaring links between data columns and visual encoding channels, such as the x-axis, y-axis, color, etc.As the overview states, "the key idea is that you are declaring links between data columns and visual encoding channels, such as the x-axis, y-axis, color, etc." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some accidental repetition here
_posts/plotting-overview.md
Outdated
```python | ||
alt.Chart(df) | ||
``` | ||
Specify what type of glyph/mark should be used to represent your data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe glyph/marker to match matplotlib usage?
_posts/plotting-overview.md
Outdated
```python | ||
mark_point() | ||
``` | ||
Then, link your data columns with the encoding channels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need comma here
_posts/plotting-overview.md
Outdated
## Matplotlib | ||
Matplotlib is a powerful object-oriented procedural plotting library. Instead of linking data with encoding channels, Matplotlib uses an object-oriented interface to place objects on a canvas. | ||
|
||
The general thought process is to create a plot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general process to create
_posts/plotting-overview.md
Outdated
) | ||
``` | ||
## Matplotlib | ||
Matplotlib is a powerful object-oriented procedural plotting library. Instead of linking data with encoding channels, Matplotlib uses an object-oriented interface to place objects on a canvas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this explaination lot! Thought maybe add a sentence/parenthetical on what a canvas is. Or add into the next sentence something like : the general process to create a plot is to first create a figure (canvas) and the subplots (objects containing the images). I'm not liking my explaination of subplots but think it needs something.
_posts/plotting-overview.md
Outdated
``` | ||
Add a scatter plot to the axes object of this figure: | ||
```python | ||
ax.scatter(x_array, y_array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both the Altair and mpl examples should be runnable, so I think you should make a teensy dataframe at the top to use with both examples. Something like 'df = pd.DataFrame({'x':[1,2,3,4,5], 'y':[4,5,6,7,8])' You can add a throwaway sentence about how we have data we want to plot and python offers us all the options.
Still need to make example plots runnable.
This is an overview of the different plotting styles between Altair and Matplotlib and a quick how to use mpl-altair.