Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing angle conversions in PGFPlotsX #4703

Merged
merged 5 commits into from
Mar 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/backends/pgfplotsx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,19 @@ function pgfx_add_series!(::Val{:heatmap}, axis, series_opt, series, series_func
"mesh/rows" => length(opt[:x]),
"mesh/cols" => length(opt[:y]),
"point meta" => "\\thisrow{meta}",
"opacity" => something(get_fillalpha(series), 1.0),
)
args = pgfx_series_arguments(series, opt)
meta = map(r -> any(!isfinite, r) ? NaN : r[3], zip(args...))
for arg in args
arg[(!isfinite).(arg)] .= 0
end
table = Table(["x" => args[1], "y" => args[2], "z" => args[3], "meta" => meta])
table = Table([
"x" => ispolar(series) ? rad2deg.(args[1]) : args[1],
"y" => args[2],
"z" => args[3],
"meta" => meta,
])
push!(axis, series_func(series_opt, table))
pgfx_add_legend!(axis, series, opt)
end
Expand Down Expand Up @@ -1025,6 +1031,8 @@ function pgfx_fillrange_series!(axis, series, series_func, i, fillrange, rng)
opt = series.plotattributes
args = if RecipesPipeline.is3d(series)
opt[:x][rng], opt[:y][rng], opt[:z][rng]
elseif ispolar(series)
rad2deg.(opt[:x][rng]), opt[:y][rng]
else
opt[:x][rng], opt[:y][rng]
end
Expand Down