You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to combine two point density charts that share their coloraxis. For heatmaps this does not seems to be a problem, but for point density charts you have to (i) align the coloraxis, and (ii) set the contours individually.
Repro steps
code
#r "nuget: Plotly.NET.Interactive"openPlotly.NETopenPlotly.NET.LayoutObjectsopenPlotly.NET.TraceObjectsopenPlotly.NET.StyleParamletgetZeroCollection n :float []=
Array.zeroCreate n
[
Chart.PointDensity(
x=(getZeroCollection 100),
y=(getZeroCollection 100))|> Chart.withColorAxisAnchor(1)
Chart.PointDensity(
x =(getZeroCollection 50),
y =(getZeroCollection 50))|> Chart.withColorAxisAnchor(1)]|> Chart.Grid(2,1)
The inner circle of the second chart has a point density of 50, but the color scale indicates 100.
Known workarounds
By setting the contour ranges for each plot individually and setting the ColorAxis to the same range, the combined plot is correct:
[
Chart.PointDensity(
x=(getZeroCollection 100),
y=(getZeroCollection 100))|> Chart.withColorAxisAnchor(1)|> GenericChart.mapiTrace (fun i t ->if i =0then t?contours <-(Contours.init(Start =0, End =100)); t else t)
Chart.PointDensity(
x =(getZeroCollection 50),
y =(getZeroCollection 50))|> Chart.withColorAxisAnchor(1)|> GenericChart.mapiTrace (fun i t ->if i =0then t?contours <-(Contours.init(Start =0, End =100)); t else t)]|> Chart.Grid(2,1)|> Chart.withColorAxis(colorAxis=ColorAxis.init(CMin=0.,CMax=70.),Id=SubPlotId.ColorAxis 1)
Solution
The easiest solution is to add an option to either Chart.Grid or Chart.withLayoutStyle that enables to share the color axis for each density point chart.
If that is not possible, contours should be accessible from Chart.PointDensity()
The text was updated successfully, but these errors were encountered:
Note that this is only relevant to the traces that pre-render the contours as an image layer, namely Contour and Histogram2DContour. I think these should expose min/max contour settings directly, in addition to exposing setting Contours as an object.
Description
I tried to combine two point density charts that share their coloraxis. For heatmaps this does not seems to be a problem, but for point density charts you have to (i) align the coloraxis, and (ii) set the contours individually.
Repro steps
code
The inner circle of the second chart has a point density of 50, but the color scale indicates 100.
Known workarounds
By setting the contour ranges for each plot individually and setting the ColorAxis to the same range, the combined plot is correct:
Solution
Chart.Grid
orChart.withLayoutStyle
that enables to share the color axis for each density point chart.contours
should be accessible fromChart.PointDensity()
The text was updated successfully, but these errors were encountered: