Skip to content

DOC: Visualization reorganization #7027

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

Conversation

TomAugspurger
Copy link
Contributor

Closes #6994

I still need to do one more read through. Happy to hear additional suggestions.

@TomAugspurger
Copy link
Contributor Author

I put all the random seeds in :suppress:ed python blocks and noted that at the top.

I expanded doc/source/ecosystem.rst a bit, and linked to a vis section from visualization.rst.

`Seaborn <https://github.com/mwaskom/seaborn>`__
------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copy link
Member

Choose a reason for hiding this comment

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

Can you make the line as long as the line above? (it is not needed in rst actually, but sphinx gives a warning about it, so this is an easy thing to avoid those warnings)

@jorisvandenbossche
Copy link
Member

@TomAugspurger I added some comments. But really like it, good improvements!

A more general question: is it needed to put a np.random.seed before every random call instead of just once in the beginning of the file (as it was before I think)?

@TomAugspurger
Copy link
Contributor Author

Thanks, I appreciate it.

For the random seeding we get two benefits. If someone is following along with the docs they'll be able to reproduce a specific plot exactly (without having to plot everyone up to that point so that their seed is in the same place as the docs).

Second, adding new plots that make calls to np.random won't change the plots later on in the docs (since they'll be bumped to the next slot in the random seed).

These are very minor benefits, but not too costly I think. The toughest part will be maintanance.

@jreback jreback added this to the 0.14.0 milestone May 5, 2014
@jreback jreback added the Docs label May 5, 2014
@TomAugspurger
Copy link
Contributor Author

OK, this should be about ready. I changed the organization a bit, but I think it flows better now. Basically now its:

  • Plot basics (df.plot(), series.plot())
  • Other plots (bar, hist, scatter_matrix, etc.)
  • Formatting / Styling

Before we went from basics and mixed in a bit of styling. I think the old way of going into specifics like x_compat before showing how to do a bar chart isn't great. But let me know what you think.

I'd like to get #6976 in, then I'll rebase on top of that and merge this.

@TomAugspurger
Copy link
Contributor Author

Ok. I rebased on top of master now that #6976 is merged, so this is ready. Let me know if you disagree with the new layout, and I'll change it back.

@jreback
Copy link
Contributor

jreback commented May 5, 2014

looks good to me, @jorisvandenbossche

maybe throw a click reference to the controlling plot options in the Basic Plot section / intro ?

@jorisvandenbossche
Copy link
Member

New layout seems good to me also.

  • You changed the title Plotting with matplotlib to Plotting Basics (that is also the title that will appear in the docs sidebar). Now, the new name seems to suggest there is also an 'advanced' plotting section?
  • maybe you could also split the 'Other plots' section in two? One on the other 'plot types/kinds' through plot(... kind='...') and one on the other plotting functions from pd.tools.plotting? Just an idea, not that important.

@TomAugspurger
Copy link
Contributor Author

I had a second top level section, but I removed it so that the main sidebar would only have one plotting item. I think I'll just change Plotting Basics to Plotting.

For splitting the other section in two: this is what I wanted to do originally. But I like having the section with the two lists (one for kinds and one for pd.tools.plotting). I think I've got a reasonable compromise that I'll push up.

@jreback
Copy link
Contributor

jreback commented May 5, 2014

This pie plot just updated, can you use the plurals (e.g. You can create pie plots.... )

Pie plot

New in version 0.14.

You can create pie plot with DataFrame.plot or Series.plot with kind='pie'. If data includes NaN, it will be automatically filled by 0. If data contains negative value, ValueError will be raised.

@jreback
Copy link
Contributor

jreback commented May 5, 2014

I would make styling a top-level bullet

@jreback
Copy link
Contributor

jreback commented May 5, 2014

@TomAugspurger I would go ahead and merge when you are ready...

prob easier to comment after we see it built

and can always do follows

- add matplotlib to intersphinx
- put random seeds in supress and note
- use versionadded in more places
- link to api on more methods
- title case titles
- reorganize hierarchy

The new hierarchy is

- Basic Plotting (line plots on Frame and Series)
- Other Plots (bar, scatter, etc.)
- Plot formatting

DOC: add ecosystem note to top of visualization.rst

DOC: use cubehelix, not jet

fix line lengths on headers

reorg hierarchy to basic, other, and styling

Change matplotlib url
TomAugspurger pushed a commit that referenced this pull request May 5, 2014
@TomAugspurger TomAugspurger merged commit e94e38a into pandas-dev:master May 5, 2014
@TomAugspurger
Copy link
Contributor Author

@TomAugspurger
Copy link
Contributor Author

  • kde doesn't have its own section header.
  • df['b'] = df['b'] = df['b'] + np.arange(1000) in hexbin, extra df['b']

@jreback
Copy link
Contributor

jreback commented May 5, 2014

maybe move those top 2 notes (random and ecosystem), to the end of the Basic Plotting section...

@jreback
Copy link
Contributor

jreback commented May 5, 2014

looks good!

@jorisvandenbossche
Copy link
Member

Looking good! Thanks a lot

keywords are passed alogn to the corresponding matplotlib function
(:meth:`ax.plot() <matplotlib.axes.Axes.plot>`,
:meth: `ax.bar() <matplotlib.axes.Axes.bar>`,
:meth: `ax.scatter() <matplotlib.axes.Axes.scatter>`). These can be used
Copy link
Member

Choose a reason for hiding this comment

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

just noticed, the spaces in the three lines above (in :meth: ... -> `:meth:`...) causes this not to render well

@TomAugspurger TomAugspurger deleted the visualization-rewrite branch April 5, 2017 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Reorganize plotting.rst
3 participants