Repository navigation
Conversation
fill_betweenx is the same band as fill_between with the axes read the other way round, so it is the same series with a flag rather than a kind of its own. stackplot is nothing but a run of bands, each starting where the last one stopped. axline is the one that needs its own drawing: it has no extent, so it takes no part in the limits and is clipped to the axes rectangle in pixels.
The axes carried a tight flag, which was only ever the question of whether the five percent margin was applied. A margin per axis says the same thing and says more, so tight becomes a margin of nothing and margins() sets whatever else is wanted. autoscale() then pins the limits where the data has put them, which is the only way to stop an axis from growing with what is drawn next.
The bar was three tuned constants, one of which was a width fraction that only came out right at the default figure size; matplotlib gets the same number from an aspect ratio, so a bar in a narrow subplot was too thin. Taking matplotlib's four numbers instead - fraction, pad, shrink and aspect - gives the horizontal bar for free, since the only difference is which way the slices and the ticks run.
Matplotlib hatches by tiling a pattern behind the shape and clipping it to the path; the backend API here clips to rectangles only, on purpose, so the lines are cut to the shape where they are made instead. A ruled line crosses the outline an even number of times, so the crossings sort into pairs and each pair is one dash, which works for any polygon and asks nothing of the four backends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #9 (branch
polish1); merge that first.Six commits, one per item of the Tier 3 list:
fill_betweenx,stackplotandaxline.fill_betweenxis the same series asfill_betweenwith ahorizflag, so it keeps the legend swatch, colour cycle, alpha andwhere=for free;axlinetakes no part in the limits and is clipped to the axes rectangle in pixels.axes_t%tightis gone, replaced byxmargin/ymargin, withmargins()andautoscale()on top.axis("tight")is now "set the margins to zero".orientation,fraction,pad,shrinkandaspect, with the geometry measured off matplotlib rather than guessed; the old fixed width fraction was only right at the default figure size.\frac,\sqrtand the greek letters. Fractions and roots need strokes, so a run may now be a line as well as a piece of text. Greek meant making text UTF-8: SVG emits a character reference, PNG has the DejaVu greek outlines, and PDF/EPS fill those outlines since no core font carries greek.plot_wireframe, andplot_surface(cmap=).Cases 91-96 in
tests/test_plots.f90with matching matplotlib references. All five harnesses pass: SVG structure, PNG (mean 1.60/255), PDF, EPS and GIF.