Skip to content

doc: add plots to docstrings and reference to in what's new #1369

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

Closed
timmie opened this issue Jun 1, 2012 · 5 comments
Closed

doc: add plots to docstrings and reference to in what's new #1369

timmie opened this issue Jun 1, 2012 · 5 comments
Labels

Comments

@timmie
Copy link
Contributor

timmie commented Jun 1, 2012

Enhanced time series plotting; adaptation of scikits.timeseries matplotlib-based plotting code

Let's add sample plots to this.

Continuing discussion on doc, I suggest to take a similar approach like statsmodels:

http://statsmodels.sourceforge.net/devel/generated/statsmodels.graphics.functional.rainbowplot.html#statsmodels.graphics.functional.rainbowplot

The plot in the docs is generated from the docstring
the Sphinx source:
http://statsmodels.sourceforge.net/devel/_sources/generated/statsmodels.graphics.functional.rainbowplot.txt
the docstring:
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/graphics/functional.py#L208
So

.. ipython:: python

   ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000))
   ts = ts.cumsum()

   @savefig series_plot_basic.png width=4.5in
   ts.plot()

could be moved to a docstrin in cases where it makes sense.

Can we not reuse the test code that may already be in the code base?
https://github.com/pydata/pandas/blob/master/pandas/tests/test_graphics.py#L39

The major problem is that the test writing set-up in pandas is highly modular while docstrings à la statsmodels are more verbose.

But, taking a second look at the docstring above, the tests could actually be used to produce doc plots:

instead

.. plot:: plots/graphics_functional_rainbowplot.py

use

.. plot:: plots/file_with_plot_examples.py

In file file_with_plot_examples.py you may for the mean time import the test functions.

On the other hand, such plot files:
https://github.com/statsmodels/statsmodels/blob/master/docs/source/plots/graphics_functional_rainbowplot.py
coudl be easily contributed by pandas users for more cases that core devs are probably thinging of currently.

@timmie
Copy link
Contributor Author

timmie commented Jun 1, 2012

I hope my brainstroming above did not confuse too much.
It's my first familiarisation with pandas docs and trying to push ideas around...

@changhiskhan
Copy link
Contributor

The statsmodels docs you linked to are API docs, which are very useful and
something we definitely would like to have.
However, it is different from the pandas documentation which is more of an
in-depth guide/tutorial.
So it's not a question of which approach to choose at all.

On Fri, Jun 1, 2012 at 3:41 AM, timmie <
[email protected]

wrote:

Enhanced time series plotting; adaptation of scikits.timeseries
matplotlib-based plotting code

Let's add sample plots to this.

Continuing discussion on doc, I suggest to take a similar approach like
statsmodels:

http://statsmodels.sourceforge.net/devel/generated/statsmodels.graphics.functional.rainbowplot.html#statsmodels.graphics.functional.rainbowplot

The plot in the docs is generated from the docstring
the Sphinx source:

http://statsmodels.sourceforge.net/devel/_sources/generated/statsmodels.graphics.functional.rainbowplot.txt
the docstring:

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/graphics/functional.py#L208

Can we not reuse the test code that may already be in the code base?


Reply to this email directly or view it on GitHub:
#1369

Chang She
Lambda Foundry http://www.lambdafoundry.com

@timmie
Copy link
Contributor Author

timmie commented Jun 27, 2012

could you add the community tag to this?

@mbirdi
Copy link

mbirdi commented Apr 24, 2015

Can this doc issue be closed? No activity since 2012.

@TomAugspurger
Copy link
Contributor

Closing this as completed.

@jorisvandenbossche jorisvandenbossche modified the milestones: No action, Someday Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants