Compare commits

...

6 Commits

Author SHA1 Message Date
Simon Christ 9b4c66be9a adjust markersize (#2589)
* fix px to pt conversion for markers

* fix test

* bump version [skip ci]

@JuliaRegistrator register
2020-04-16 15:13:21 +02:00
Daniel Schwabeneder 3b3a09302f Merge pull request #2584 from isentropic/isen-dev2
Isen dev2
2020-04-16 09:59:29 +02:00
Zh c01ee17d88 pyplot markercolor 2020-04-16 01:21:05 +09:00
Zh 8c9422f470 py_get<component>color removal;
marker stroke, adjustments
2020-04-16 00:32:33 +09:00
Zh 7c88256ca4 Merge branch 'master' into isen-dev2 2020-04-15 23:33:39 +09:00
Zh f5fe2692e2 Merge branch 'master' into isen-dev 2020-04-15 23:33:26 +09:00
4 changed files with 16 additions and 21 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name = "Plots"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
author = ["Tom Breloff (@tbreloff)"]
version = "1.0.10"
version = "1.0.11"
[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
+2 -2
View File
@@ -768,7 +768,7 @@ function pgfx_marker(plotattributes, i = 1)
a_stroke = alpha(cstr_stroke)
mark_size =
pgfx_thickness_scaling(plotattributes) *
0.5 *
0.75 *
_cycle(plotattributes[:markersize], i)
return PGFPlotsX.Options(
"mark" =>
@@ -780,7 +780,7 @@ function pgfx_marker(plotattributes, i = 1)
"fill" => cstr,
"fill opacity" => a,
"line width" =>
pgfx_thickness_scaling(plotattributes) *
pgfx_thickness_scaling(plotattributes) * 0.75 *
_cycle(plotattributes[:markerstrokewidth], i),
"rotate" => if shape == :dtriangle
180
+12 -17
View File
@@ -229,11 +229,6 @@ function fix_xy_lengths!(plt::Plot{PyPlotBackend}, series::Series)
end
end
py_linecolor(series::Series) = py_color(series[:linecolor])
py_markercolor(series::Series) = py_color(series[:markercolor])
py_markerstrokecolor(series::Series) = py_color(series[:markerstrokecolor])
py_fillcolor(series::Series) = py_color(series[:fillcolor])
py_linecolormap(series::Series) = py_colormap(series[:linecolor])
py_markercolormap(series::Series) = py_colormap(series[:markercolor])
py_fillcolormap(series::Series) = py_colormap(series[:fillcolor])
@@ -486,8 +481,8 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
:arrowstyle => "simple,head_length=$(a.headlength),head_width=$(a.headwidth)",
:shrinkA => 0,
:shrinkB => 0,
:edgecolor => py_linecolor(series),
:facecolor => py_linecolor(series),
:edgecolor => py_color(get_linecolor(series)),
:facecolor => py_color(get_linecolor(series)),
:linewidth => py_thickness_scale(plt, get_linewidth(series)),
:linestyle => py_linestyle(st, get_linestyle(series)),
)
@@ -533,11 +528,11 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
handle = []
x,y = xyargs
shapes = series[:markershape]
msc = py_markerstrokecolor(series)
msc = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series))
lw = py_thickness_scale(plt, series[:markerstrokewidth])
for i=eachindex(y)
if series[:marker_z] !== nothing
extrakw[:c] = [py_color(get_markercolor(series, i))]
extrakw[:c] = [py_color(get_markercolor(series, i), get_markercoloralpha(series, i))]
end
push!(handle, ax."scatter"(_cycle(x,i), _cycle(y,i);
@@ -545,7 +540,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex] + 0.5,
marker = py_marker(_cycle(shapes,i)),
s = py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2),
facecolors = get_markercolor(series, i),
facecolors = py_color(get_markercolor(series, i), get_markercoloralpha(series, i)),
edgecolors = msc,
linewidths = lw,
extrakw...
@@ -585,7 +580,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex] + 0.5,
marker = prev_marker,
s = cur_scale_list,
edgecolors = py_markerstrokecolor(series),
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)), # Do we need include i?
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
facecolors = cur_color_list,
extrakw...
@@ -606,7 +601,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex] + 0.5,
marker = prev_marker,
s = cur_scale_list,
edgecolors = py_markerstrokecolor(series),
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
facecolors = cur_color_list,
extrakw...
@@ -621,7 +616,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex] + 0.5,
marker = py_marker(series[:markershape]),
s = py_thickness_scale(plt, series[:markersize] .^ 2),
edgecolors = py_markerstrokecolor(series),
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
extrakw...
)
@@ -635,7 +630,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex],
gridsize = series[:bins],
linewidths = py_thickness_scale(plt, series[:linewidth]),
edgecolors = py_linecolor(series),
edgecolors = py_color(get_linecolor(series)),
cmap = py_fillcolormap(series), # applies to the pcolorfast object
extrakw...
)
@@ -708,7 +703,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
rstride = series[:stride][1],
cstride = series[:stride][2],
linewidth = py_thickness_scale(plt, series[:linewidth]),
edgecolor = py_linecolor(series),
edgecolor = py_color(get_linecolor(series)),
extrakw...
)
push!(handles, handle)
@@ -734,7 +729,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
zorder = series[:series_plotindex],
cmap = py_fillcolormap(series),
linewidth = py_thickness_scale(plt, series[:linewidth]),
edgecolor = py_linecolor(series),
edgecolor = py_color(get_linecolor(series)),
extrakw...
)
push!(handles, handle)
@@ -1320,7 +1315,7 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
linestyle = py_linestyle(:path, get_linestyle(series)),
marker = py_marker(_cycle(series[:markershape], 1)),
marker = py_marker(_cycle(series[:markershape], 1)), # Need to adjust markersize to match the legend box size
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series))
)
+1 -1
View File
@@ -84,7 +84,7 @@ end
@test marker.options["mark"] == "*"
@test marker.options["mark options"]["color"] ==
RGBA{Float64}(colorant"green", 0.8)
@test marker.options["mark options"]["line width"] == 1
@test marker.options["mark options"]["line width"] == 0.75 # 1px is 0.75pt
end # testset
@testset "Plot in pieces" begin
pic = plot(rand(100) / 3, reg = true, fill = (0, :green))