Skip to content

Commit dab5780

Browse files
Revert "rename yfill -> fill"
This reverts commit da25f97.
1 parent f0d0a07 commit dab5780

File tree

19 files changed

+152
-145
lines changed

19 files changed

+152
-145
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ Many updates, min julia 1.0
590590
- allow calling `plot!(sp, ...)` to update a target Subplot
591591
- PyPlot: zorder fix
592592
- new DataFrames logic/recipe: more flexible/robust and allow Symbols for:
593-
- `(:yfill_range, :line_z, :marker_z, :marker_size, :ribbon, :weights, :xerror, :yerror)`
593+
- `(:fillrange, :line_z, :marker_z, :marker_size, :ribbon, :weights, :xerror, :yerror)`
594594
- new `display_type` and `extra_kwargs` plot attributes
595595
- surface fix
596596

@@ -808,7 +808,7 @@ Many updates, min julia 1.0
808808
- New dependency on Requires, allows auto-loading of DataFrames support
809809
- Support for plotting lists of Tuples and FixedSizeArrays
810810
- new `@animate` macro for super simple animations (see https://github.com/tbreloff/Plots.jl/issues/111#issuecomment-181515616)
811-
- allow Function for `:yfill_range` and `zcolor` arguments (for example: `scatter(sin, 0:10, marker=15, fill=(cos,0.4), zcolor=sin)`)
811+
- allow Function for `:fillrange` and `zcolor` arguments (for example: `scatter(sin, 0:10, marker=15, fill=(cos,0.4), zcolor=sin)`)
812812
- allow vectors of PlotText without x/y coords (for example: `scatter(rand(10), m=20, ann=map(text, 1:10))`)
813813
- Lots and lots of fixes
814814

RecipesPipeline/src/series_recipe.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function _process_seriesrecipe(plt, plotattributes)
3737

3838
# shapes shouldn't have fillrange set
3939
if plotattributes[:seriestype] == :shape
40-
plotattributes[:yfill_range] = nothing
40+
plotattributes[:fillrange] = nothing
4141
end
4242

4343
# if it's natively supported, finalize processing and pass along to the backend,

src/arg_desc.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const _arg_desc = KW(
1010
:line_width => "Number. Width of the line (in pixels)",
1111
:line_color => "Color Type. Color of the line (for path and bar stroke). `:match` will take the value from `:seriescolor`, (though histogram/bar types use `:black` as a default).",
1212
:line_alpha => "Number in [0,1]. The alpha/opacity override for the line. `nothing` (the default) means it will take the alpha value of linecolor.",
13-
:yfill_range => "Number or AbstractVector. Fills area between fillrange and y for line-types, sets the base for bar/stick types, and similar for other types.",
14-
:yfill_color => "Color Type. Color of the filled area of path or bar types. `:match` will take the value from `:seriescolor`.",
15-
:yfill_alpha => "Number in [0,1]. The alpha/opacity override for the fill area. `nothing` (the default) means it will take the alpha value of fillcolor.",
13+
:fillrange => "Number or AbstractVector. Fills area between fillrange and y for line-types, sets the base for bar/stick types, and similar for other types.",
14+
:fillcolor => "Color Type. Color of the filled area of path or bar types. `:match` will take the value from `:seriescolor`.",
15+
:fillalpha => "Number in [0,1]. The alpha/opacity override for the fill area. `nothing` (the default) means it will take the alpha value of fillcolor.",
1616
:marker_shape => "Symbol, Shape, or AbstractVector. Choose from $(_allMarkers).",
17-
:yfill_style => "Symbol. Style of the fill area. `nothing` (the default) means solid fill. Choose from :/, :\\, :|, :-, :+, :x",
17+
:fillstyle => "Symbol. Style of the fill area. `nothing` (the default) means solid fill. Choose from :/, :\\, :|, :-, :+, :x",
1818
:marker_color => "Color Type. Color of the interior of the marker or shape. `:match` will take the value from `:seriescolor`.",
1919
:marker_alpha => "Number in [0,1]. The alpha/opacity override for the marker interior. `nothing` (the default) means it will take the alpha value of markercolor.",
2020
:marker_size => "Number or AbstractVector. Size (radius pixels) of the markers",

src/args.jl

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ const _series_defaults = KW(
338338
:seriescolor => :auto,
339339
:seriesalpha => nothing,
340340
:seriestype => :path,
341+
:fillrange => nothing, # ribbons, areas, etc
342+
:fillcolor => :match,
343+
:fillalpha => nothing,
344+
:fillstyle => nothing,
341345
:bins => :auto, # number of bins for hists
342346
:smooth => false, # regression line?
343347
:group => nothing, # groupby vector
@@ -568,6 +572,7 @@ add_aliases(:right_margin, :rightmargin)
568572

569573
# colors
570574
add_aliases(:seriescolor, :c, :color, :colour)
575+
add_aliases(:fillcolor, :fc, :fcolor, :fcolour, :fillcolour)
571576

572577
add_aliases(
573578
:background_color,
@@ -782,6 +787,7 @@ add_aliases(
782787

783788
# alphas
784789
add_aliases(:seriesalpha, :alpha, , :opacity)
790+
add_aliases(:fillalpha, :fa, :falpha, :fα, :fillopacity, :fopacity)
785791

786792
# axes attributes
787793
add_axes_aliases(:guide, :label, :lab, :l; generic = false)
@@ -865,6 +871,7 @@ add_aliases(:marker, :m, :mark)
865871
add_aliases(:marker_z, :markerz, :zcolor, :mz)
866872
add_aliases(:line_z, :linez, :zline, :lz)
867873
add_aliases(:fill, :f, :area)
874+
add_aliases(:fillrange, :fillrng, :frange, :fillto, :fill_between)
868875
add_aliases(:group, :g, :grouping)
869876
add_aliases(:bins, :bin, :nbin, :nbins, :nb)
870877
add_aliases(:ribbon, :rib)
@@ -1079,13 +1086,13 @@ function processLineArg(plotattributes::AKW, arg)
10791086
arg.style === nothing || (plotattributes[:line_style] = arg.style)
10801087

10811088
elseif typeof(arg) <: Brush
1082-
arg.size === nothing || (plotattributes[:yfill_range] = arg.size)
1089+
arg.size === nothing || (plotattributes[:fillrange] = arg.size)
10831090
arg.color === nothing || (
1084-
plotattributes[:yfill_color] =
1091+
plotattributes[:fillcolor] =
10851092
arg.color === :auto ? :auto : plot_color(arg.color)
10861093
)
1087-
arg.alpha === nothing || (plotattributes[:yfill_alpha] = arg.alpha)
1088-
arg.style === nothing || (plotattributes[:yfill_style] = arg.style)
1094+
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
1095+
arg.style === nothing || (plotattributes[:fillstyle] = arg.style)
10891096

10901097
elseif typeof(arg) <: Arrow || arg in (:arrow, :arrows)
10911098
plotattributes[:arrow] = arg
@@ -1149,35 +1156,35 @@ function processMarkerArg(plotattributes::AKW, arg)
11491156
end
11501157

11511158
function processFillArg(plotattributes::AKW, arg)
1152-
# fr = get(plotattributes, :yfill_range, 0)
1159+
# fr = get(plotattributes, :fillrange, 0)
11531160
if typeof(arg) <: Brush
1154-
arg.size === nothing || (plotattributes[:yfill_range] = arg.size)
1161+
arg.size === nothing || (plotattributes[:fillrange] = arg.size)
11551162
arg.color === nothing || (
1156-
plotattributes[:yfill_color] =
1163+
plotattributes[:fillcolor] =
11571164
arg.color === :auto ? :auto : plot_color(arg.color)
11581165
)
1159-
arg.alpha === nothing || (plotattributes[:yfill_alpha] = arg.alpha)
1160-
arg.style === nothing || (plotattributes[:yfill_style] = arg.style)
1166+
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
1167+
arg.style === nothing || (plotattributes[:fillstyle] = arg.style)
11611168

11621169
elseif typeof(arg) <: Bool
1163-
plotattributes[:yfill_range] = arg ? 0 : nothing
1170+
plotattributes[:fillrange] = arg ? 0 : nothing
11641171

11651172
# fillrange function
11661173
elseif allFunctions(arg)
1167-
plotattributes[:yfill_range] = arg
1174+
plotattributes[:fillrange] = arg
11681175

11691176
# fillalpha
11701177
elseif allAlphas(arg)
1171-
plotattributes[:yfill_alpha] = arg
1178+
plotattributes[:fillalpha] = arg
11721179

11731180
# fillrange provided as vector or number
11741181
elseif typeof(arg) <: Union{AbstractArray{<:Real},Real}
1175-
plotattributes[:yfill_range] = arg
1182+
plotattributes[:fillrange] = arg
11761183

1177-
elseif !handleColors!(plotattributes, arg, :yfill_color)
1178-
plotattributes[:yfill_range] = arg
1184+
elseif !handleColors!(plotattributes, arg, :fillcolor)
1185+
plotattributes[:fillrange] = arg
11791186
end
1180-
# plotattributes[:yfill_range] = fr
1187+
# plotattributes[:fillrange] = fr
11811188
nothing
11821189
end
11831190

@@ -2042,7 +2049,7 @@ function _update_series_attributes!(plotattributes::AKW, plt::Plot, sp::Subplot)
20422049
)
20432050

20442051
# update alphas
2045-
for asym in (:line_alpha, :marker_alpha, :yfill_alpha)
2052+
for asym in (:line_alpha, :marker_alpha, :fillalpha)
20462053
if plotattributes[asym] === nothing
20472054
plotattributes[asym] = plotattributes[:seriesalpha]
20482055
end
@@ -2057,7 +2064,7 @@ function _update_series_attributes!(plotattributes::AKW, plt::Plot, sp::Subplot)
20572064
plotattributes[:seriescolor] = scolor = get_series_color(scolor, sp, plotIndex, stype)
20582065

20592066
# update other colors
2060-
for s in (:line_, :marker_, :yfill_)
2067+
for s in (:line_, :marker_, :fill)
20612068
csym, asym = Symbol(s, :color), Symbol(s, :alpha)
20622069
plotattributes[csym] = if plotattributes[csym] === :auto
20632070
plot_color(if has_black_border_for_default(stype) && s === :line
@@ -2089,7 +2096,7 @@ function _update_series_attributes!(plotattributes::AKW, plt::Plot, sp::Subplot)
20892096
ensure_gradient!(plotattributes, :line_color, :line_alpha)
20902097
end
20912098
if plotattributes[:fill_z] !== nothing
2092-
ensure_gradient!(plotattributes, :yfill_color, :yfill_alpha)
2099+
ensure_gradient!(plotattributes, :fillcolor, :fillalpha)
20932100
end
20942101

20952102
# scatter plots don't have a line, but must have a shape

src/axes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function expand_extrema!(sp::Subplot, plotattributes::AKW)
455455
# end
456456

457457
# expand for fillrange
458-
fr = plotattributes[:yfill_range]
458+
fr = plotattributes[:fillrange]
459459
if fr === nothing && plotattributes[:seriestype] === :bar
460460
fr = 0.0
461461
end
@@ -514,7 +514,7 @@ end
514514
scale_lims!([plt], [letter], factor)
515515
516516
Scale the limits of the axis specified by `letter` (one of `:x`, `:y`, `:z`) by the
517-
given `factor` around the limits' middle point.
517+
given `factor` around the limits' middle point.
518518
If `letter` is omitted, all axes are affected.
519519
"""
520520
function scale_lims!(sp::Subplot, letter, factor)

src/backends.jl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ const _gr_attr = merge_with_base_supported([
315315
:marker_stroke_width,
316316
:marker_stroke_color,
317317
:marker_stroke_alpha,
318-
:yfill_range,
319-
:yfill_color,
320-
:yfill_alpha,
321-
:yfill_style,
318+
:fillrange,
319+
:fillcolor,
320+
:fillalpha,
321+
:fillstyle,
322322
:bins,
323323
:layout,
324324
:title,
@@ -448,9 +448,9 @@ const _plotly_attr = merge_with_base_supported([
448448
:marker_stroke_color,
449449
:marker_stroke_alpha,
450450
:marker_stroke_style,
451-
:yfill_range,
452-
:yfill_color,
453-
:yfill_alpha,
451+
:fillrange,
452+
:fillcolor,
453+
:fillalpha,
454454
:bins,
455455
:title,
456456
:titlelocation,
@@ -573,9 +573,9 @@ const _pgfplots_attr = merge_with_base_supported([
573573
:marker_stroke_color,
574574
:marker_stroke_alpha,
575575
:marker_stroke_style,
576-
:yfill_range,
577-
:yfill_color,
578-
:yfill_alpha,
576+
:fillrange,
577+
:fillcolor,
578+
:fillalpha,
579579
:bins,
580580
# :bar_width, :bar_edges,
581581
:title,
@@ -687,10 +687,10 @@ const _pyplot_attr = merge_with_base_supported([
687687
:marker_stroke_width,
688688
:marker_stroke_color,
689689
:marker_stroke_alpha,
690-
:yfill_range,
691-
:yfill_color,
692-
:yfill_alpha,
693-
:yfill_style,
690+
:fillrange,
691+
:fillcolor,
692+
:fillalpha,
693+
:fillstyle,
694694
:bins,
695695
:bar_width,
696696
:bar_edges,
@@ -806,7 +806,7 @@ const _gaston_attr = merge_with_base_supported([
806806
:marker_size,
807807
:marker_alpha,
808808
# :marker_stroke_width, :marker_stroke_color, :marker_stroke_alpha, :marker_stroke_style,
809-
# :yfill_range, :yfill_color, :yfill_alpha,
809+
# :fillrange, :fillcolor, :fillalpha,
810810
# :bins,
811811
# :bar_width, :bar_edges,
812812
:title,
@@ -988,9 +988,9 @@ const _hdf5_attr = merge_with_base_supported([
988988
:marker_stroke_width,
989989
:marker_stroke_color,
990990
:marker_stroke_alpha,
991-
:yfill_range,
992-
:yfill_color,
993-
:yfill_alpha,
991+
:fillrange,
992+
:fillcolor,
993+
:fillalpha,
994994
:bins,
995995
:bar_width,
996996
:bar_edges,
@@ -1094,8 +1094,8 @@ const _inspectdr_attr = merge_with_base_supported([
10941094
:marker_stroke_color,
10951095
:marker_stroke_alpha,
10961096
:marker_stroke_style, #Causes warning not to have it... what is this?
1097-
:yfill_color,
1098-
:yfill_alpha, #:yfill_range,
1097+
:fillcolor,
1098+
:fillalpha, #:fillrange,
10991099
# :bins, :bar_width, :bar_edges, :bar_position,
11001100
:title,
11011101
:titlelocation,
@@ -1195,9 +1195,9 @@ const _pgfplotsx_attr = merge_with_base_supported([
11951195
:marker_stroke_width,
11961196
:marker_stroke_color,
11971197
:marker_stroke_alpha,
1198-
:yfill_range,
1199-
:yfill_color,
1200-
:yfill_alpha,
1198+
:fillrange,
1199+
:fillcolor,
1200+
:fillalpha,
12011201
:bins,
12021202
:layout,
12031203
:title,

src/backends/deprecated/pgfplots.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ function pgf_series(sp::Subplot, series::Series)
225225

226226
# add to legend?
227227
if i == 1 && sp[:legend_position] !== :none && should_add_to_legend(series)
228-
if plotattributes[:yfill_range] !== nothing
228+
if plotattributes[:fillrange] !== nothing
229229
push!(style, "forget plot")
230230
push!(series_collection, pgf_fill_legend_hack(plotattributes, args))
231231
else
232232
kw[:legendentry] = plotattributes[:label]
233-
if st === :shape # || plotattributes[:yfill_range] !== nothing
233+
if st === :shape # || plotattributes[:fillrange] !== nothing
234234
push!(style, "area legend")
235235
end
236236
end
@@ -247,13 +247,13 @@ function pgf_series(sp::Subplot, series::Series)
247247
kw[:style] = join(style, ',')
248248

249249
# add fillrange
250-
if series[:yfill_range] !== nothing && st !== :shape
250+
if series[:fillrange] !== nothing && st !== :shape
251251
push!(
252252
series_collection,
253253
pgf_fillrange_series(
254254
series,
255255
i,
256-
_cycle(series[:yfill_range], rng),
256+
_cycle(series[:fillrange], rng),
257257
seg_args...,
258258
),
259259
)
@@ -641,7 +641,7 @@ function _update_plot_object(plt::Plot{PGFPlotsBackend})
641641
# As it is likely that all series within the same axis use the same
642642
# colormap this should not cause any problem.
643643
for series in series_list(sp)
644-
for col in (:marker_color, :yfill_color, :line_color)
644+
for col in (:marker_color, :fillcolor, :line_color)
645645
if typeof(series.plotattributes[col]) == ColorGradient
646646
push!(
647647
style,

src/backends/gaston.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
222222
if gsp.dims == 2 && z === nothing
223223
for (n, seg) in enumerate(series_segments(series, st; check = true))
224224
i, rng = seg.attr_index, seg.range
225-
fr = _cycle(series[:yfill_range], 1:length(x[rng]))
225+
fr = _cycle(series[:fillrange], 1:length(x[rng]))
226226
for sc in gaston_seriesconf!(sp, series, i, n == 1)
227227
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, fr, sc))
228228
end
@@ -296,7 +296,7 @@ function gaston_seriesconf!(
296296
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
297297
push!(curveconf, "w points pt $pt ps $ps lc $mc")
298298
elseif st (:path, :straightline, :path3d)
299-
fr = series[:yfill_range]
299+
fr = series[:fillrange]
300300
fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i))
301301
fs = get_fillstyle(series, i) # FIXME: add fillstyle support ?
302302
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)

0 commit comments

Comments
 (0)