X Tutup
Skip to content

Improvements to pylab_examples/stock_demo.py #7457

@anntzer

Description

@anntzer

See http://matplotlib.org/devdocs/examples/pylab_examples/stock_demo.html

  • the plot looks really terrible (I would suggest taking inspiration from how these kind of plots (in the finance world) looks like).
  • getting the data from the separate data_helper.py seems a bit overkill (that file defines get_two_stock_data, which is only used here, and get_daily_data, which is used nowhere). Note that in fact, lib/matplotlib/mpl-data/sample_data contains three files with the AAPL data (I'm assuming it's the same), they could probably be consolidated across the examples...
  • the "modern" way of setting labels is ax.plot(..., label="foo") and later just call ax.legend() with no arguments. More generally the example could be OO'ified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup