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

PlotLayout has no field coloraxis #46

Open
honghuzi opened this issue Jul 21, 2022 · 3 comments
Open

PlotLayout has no field coloraxis #46

honghuzi opened this issue Jul 21, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@honghuzi
Copy link

as the doc string of PlotDataMarker says

`coloraxis::String` - Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.

however, when i write a PlotLayout like

const preview_layout = PlotLayout(
    title = PlotLayoutTitle(text = "Densified Overlay preview", font = Font(24)),
    showlegend = true,
    grid = PlotLayoutGrid(rows = 1, columns = 2, pattern = "independent"),
    xaxis = [PlotLayoutAxis(xy = "x", index = i, title = "x") for i = 1:2],
    yaxis = [PlotLayoutAxis(xy = "y", index = i, title = "y") for i = 1:2],
    coloraxis = [PlotLayoutAxis(xy = "z", index = i, title = "z") for i = 1:2]
    )

the error message shows that

ERROR: type PlotLayout has no field coloraxis
@AbhimanyuAryan AbhimanyuAryan self-assigned this Jul 21, 2022
@AbhimanyuAryan
Copy link
Member

AbhimanyuAryan commented Jul 21, 2022

Hi,

Thanks for reporting. Looks the problem here you are trying to assign an object of type Vector{PlotLayoutAxis} in coloraxis instead of string

@AbhimanyuAryan AbhimanyuAryan added the bug Something isn't working label Jul 21, 2022
@honghuzi
Copy link
Author

I write the code as:

PlotData(
        x = sort(unique(df.x)),
        y = sort(unique(df.y)),
        z = [res[i, :] for i = 1:size(res, 1)],
        xaxis = "x$idx",
        yaxis = "y$idx",
        coloraxis = "z$idx",
        name = name,
        plot = StipplePlotly.Charts.PLOT_TYPE_HEATMAP,
    )

In StipplePlotly/src/Charts.jl, the docstring of the PlotData coloraxis keyword argument is

Settings for these shared color axes are set in the layout, under layout.coloraxis, layout.coloraxis2

however, i searched StipplePlotly/src/Layout.jl, and found no "coloraxis", this might be a not yet implemented feature in Layout.jl but referenced in Charts.jl

@AbhimanyuAryan
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants