Merge 4002748dd4a79c7d34b1befdac3774782abbdfe2 into 40b49b9873a62f37bd74dad51d21f92cadbc1c1f

This commit is contained in:
Naoki Saito 2017-01-09 20:18:06 +00:00 committed by GitHub
commit 35ed239d6f
4 changed files with 19 additions and 2 deletions

View File

@ -29,6 +29,7 @@ const _arg_desc = KW(
:z => "Various. Input data. Third Dimension. May be wrapped by a `Surface` for surface and heatmap types.", :z => "Various. Input data. Third Dimension. May be wrapped by a `Surface` for surface and heatmap types.",
:marker_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series data point, which correspond to the color to be used from a markercolor gradient.", :marker_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series data point, which correspond to the color to be used from a markercolor gradient.",
:line_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series line segment, which correspond to the color to be used from a linecolor gradient. Note that for N points, only the first N-1 values are used (one per line-segment).", :line_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series line segment, which correspond to the color to be used from a linecolor gradient. Note that for N points, only the first N-1 values are used (one per line-segment).",
:surfacecolor => "Matrix{Float64} of the same size as z matrix, which specifies the color of the 3D surface; the default value is `nothing`.",
:levels => "Integer, NTuple{2,Integer}. Number of levels (or x-levels/y-levels) for a contour type.", :levels => "Integer, NTuple{2,Integer}. Number of levels (or x-levels/y-levels) for a contour type.",
:orientation => "Symbol. Horizontal or vertical orientation for bar types. Values `:h`, `:hor`, `:horizontal` correspond to horizontal (sideways, anchored to y-axis), and `:v`, `:vert`, and `:vertical` correspond to vertical (the default).", :orientation => "Symbol. Horizontal or vertical orientation for bar types. Values `:h`, `:hor`, `:horizontal` correspond to horizontal (sideways, anchored to y-axis), and `:v`, `:vert`, and `:vertical` correspond to vertical (the default).",
:bar_position => "Symbol. Choose from `:overlay` (default), `:stack`. (warning: May not be implemented fully)", :bar_position => "Symbol. Choose from `:overlay` (default), `:stack`. (warning: May not be implemented fully)",

View File

@ -189,6 +189,7 @@ const _series_defaults = KW(
:marker_z => nothing, # value for color scale :marker_z => nothing, # value for color scale
:line_z => nothing, :line_z => nothing,
:levels => 15, :levels => 15,
:surfacecolor => nothing,
:orientation => :vertical, :orientation => :vertical,
:bar_position => :overlay, # for bar plots and histograms: could also be stack (stack up) or dodge (side by side) :bar_position => :overlay, # for bar plots and histograms: could also be stack (stack up) or dodge (side by side)
:bar_width => nothing, :bar_width => nothing,
@ -431,6 +432,7 @@ add_aliases(:zguide, :zlabel, :zlab, :zl)
add_aliases(:zlims, :zlim, :zlimit, :zlimits) add_aliases(:zlims, :zlim, :zlimit, :zlimits)
add_aliases(:zticks, :ztick) add_aliases(:zticks, :ztick)
add_aliases(:zrotation, :zrot, :zr) add_aliases(:zrotation, :zrot, :zr)
add_aliases(:surfacecolor, :surfacecolour, :sc, :surfcolor, :surfcolour)
add_aliases(:legend, :leg, :key) add_aliases(:legend, :leg, :key)
add_aliases(:colorbar, :cb, :cbar, :colorkey) add_aliases(:colorbar, :cb, :cbar, :colorkey)
add_aliases(:clims, :clim, :cbarlims, :cbar_lims, :climits, :color_limits) add_aliases(:clims, :clim, :cbarlims, :cbar_lims, :climits, :color_limits)

View File

@ -20,7 +20,7 @@ const _plotly_attr = merge_with_base_supported([
:guide, :lims, :ticks, :scale, :flip, :rotation, :guide, :lims, :ticks, :scale, :flip, :rotation,
:tickfont, :guidefont, :legendfont, :tickfont, :guidefont, :legendfont,
:grid, :legend, :colorbar, :grid, :legend, :colorbar,
:marker_z, :levels, :marker_z, :surfacecolor, :levels,
:ribbon, :quiver, :ribbon, :quiver,
:orientation, :orientation,
# :overwrite_figure, # :overwrite_figure,
@ -432,7 +432,7 @@ function plotly_series(plt::Plot, series::Series)
# for surface types, set the data # for surface types, set the data
if st in (:heatmap, :contour, :surface, :wireframe) if st in (:heatmap, :contour, :surface, :wireframe)
for letter in [:x,:y,:z] for letter in [:x,:y,:z,:surfacecolor]
d_out[letter] = plotly_surface_data(series, series[letter]) d_out[letter] = plotly_surface_data(series, series[letter])
end end
end end

14
test/surfacetest.jl Normal file
View File

@ -0,0 +1,14 @@
module SurfacePlotsTests
using Plots
plotlyjs();
m=32; n=5;
r = (0:m)/m
theta = reshape(pi*(-n*m:n*m)/m, 1, 2*n*m+1)
z = r * exp(im*theta)
s = r.^(1/n) * exp(im*theta/n)
x = real(z)
y = imag(z)
u = real(s)
v = imag(s)
surface(x,y,u,surfacecolor=randn(size(v)))
end