X Tutup
Skip to content

DOC: switch to O-O interface in basic examples#7066

Merged
tacaswell merged 4 commits intomatplotlib:masterfrom
phobson:oo-interface-basic-examples
Sep 22, 2016
Merged

DOC: switch to O-O interface in basic examples#7066
tacaswell merged 4 commits intomatplotlib:masterfrom
phobson:oo-interface-basic-examples

Conversation

@phobson
Copy link
Copy Markdown
Member

@phobson phobson commented Sep 8, 2016

Small PR to limit the calls to plt in the lines, bars, and markers example.

Took some artistic liberties:

  1. put the grid below the filled area
  2. added a second dashed line to this example where I set the dashes in the call to ax.plot for this example
  3. made the bars green to demonstrate the difference between color and ecolor

I think that about covers it.

scale = 200.0 * rand(n)
plt.scatter(x, y, c=color, s=scale, label=color,
ax.scatter(x, y, c=color, s=scale, label=color,
alpha=0.3, edgecolors='none')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to adjust indent for alpha?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@dopplershift Ahh yes. Good catch. I'll wait for the CI to wrap up before pushing again.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Sep 8, 2016
plt.xlabel('Performance')
plt.title('How fast do you want to go today?')
ax.barh(y_pos, performance, xerr=error, align='center',
color='green', ecolor='black')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There seems to be an indentation problem here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or a tab & space problem.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh geez -- that's embarrassing.

@NelleV
Copy link
Copy Markdown
Member

NelleV commented Sep 8, 2016

Apart from my comments, this looks good!

@phobson phobson force-pushed the oo-interface-basic-examples branch from f8b02f6 to a9fec83 Compare September 8, 2016 23:26
@phobson
Copy link
Copy Markdown
Member Author

phobson commented Sep 9, 2016

whoops -- had to restore the labels on the barh example, and went ahead with inverting the y-axis to the labels read top-to-bottom in the same order as they are in the tuple

plt.yticks(y_pos, people)
plt.xlabel('Performance')
plt.title('How fast do you want to go today?')
ax.barh(y_pos, performance, xerr=error, align='center',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we do not want to backport this to v2.x, this can use @story645 's categorical work. ax.barh(people, performance) should 'just work'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am in favor of merging now and backporting, and create another PR for the categorical bar plot.

@tacaswell tacaswell merged commit f544a83 into matplotlib:master Sep 22, 2016
tacaswell added a commit that referenced this pull request Sep 22, 2016
DOC: switch to O-O interface in basic examples
Conflicts:
	examples/lines_bars_and_markers/barh_demo.py
	  whitespace vs new code
@tacaswell
Copy link
Copy Markdown
Member

Thanks!

backported to v2.x as 215fbd1

@phobson phobson deleted the oo-interface-basic-examples branch October 14, 2016 17:01
@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0 (style change major release) Dec 7, 2016
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.

7 participants

X Tutup