4
$\begingroup$

I would like to show the edges on the following produced histogram:

This works as expected in terms of edges:

Histogram3D[
{data2000[[1]]},
ImageSize -> 1400,
ChartStyle -> Opacity[1],
ChartBaseStyle -> EdgeForm[{Black, AbsoluteThickness[1]}],
ColorFunction -> Function[{height}, ColorData["Rainbow"][height]]]

When I add a another dataset, edges disappear:

Histogram3D[
{data2000[[1]], data1950[[1]]},
ImageSize -> 1400,
ChartStyle -> Opacity[1],
ChartBaseStyle -> EdgeForm[{Black, AbsoluteThickness[1]}],
ColorFunction -> Function[{height}, ColorData["Rainbow"][height]]]

How can I get edges even when adding multiple datasets?

*Updated

$\endgroup$
0

2 Answers 2

2
$\begingroup$

The issue is caused by the hard-coded threshold on the number of bins in the function Charting`iHistogram3D: If the number of bins in either direction is equal to or greater than 50, the EdgeForm directive is reset to EdgeForm[] :

SeedRandom[1]
data = RandomReal[100, {400, 2}];

Row[Histogram3D[data, {{"Raw", #}, {"Raw", 40}}, "Count", 
    PlotLabel -> Style[{Row[{{"Raw", #}, {"Raw", 40}}, ", "]}, 16], 
    ImageSize -> 400, 
    ChartBaseStyle -> Directive[EdgeForm[{Red, AbsoluteThickness[0.1]}]], 
    Boxed -> False, Axes -> False] & /@ {40, 66}]

enter image description here

A simple work-around is to post-process the Histogram3D output to inject the desired styling:

Histogram3D[data, {{"Raw", 66}, {"Raw", 40}}, "Count", 
   ImageSize -> 700, 
   ChartBaseStyle -> Directive[EdgeForm[{Red, AbsoluteThickness[0.1]}]]] /. 
 EdgeForm[___] -> Directive[EdgeForm[{Red, AbsoluteThickness[0.1]}]]

enter image description here

Related Q/As:

$\endgroup$
1
  • $\begingroup$ You're da boss. THx $\endgroup$
    – Gouz
    Oct 9, 2020 at 16:58
0
$\begingroup$

Your thickness is too high.

Histogram3D[RandomVariate[NormalDistribution[0, 1], {500, 2}], 
 ChartBaseStyle -> EdgeForm[{Red, AbsoluteThickness[.01]}]]

enter image description here

enter image description here

$\endgroup$
4
  • $\begingroup$ data1 = RandomVariate[NormalDistribution[0, 1], {200, 2}]; histo = Histogram3D[data1, {{"Raw", 50}, {"Raw", 40}}, "Count", ChartBaseStyle -> Directive[EdgeForm[Red], Thickness[0.000001]]] ? $\endgroup$
    – cvgmt
    Oct 9, 2020 at 0:17
  • $\begingroup$ data1 = RandomVariate[NormalDistribution[0, 1], {200, 2}]; histo = Histogram3D[data1, {{"Raw", 49}, {"Raw", 40}}, "Count", ChartBaseStyle -> Directive[EdgeForm[Red], Thickness[10000000]]] ?? $\endgroup$
    – cvgmt
    Oct 9, 2020 at 0:20
  • $\begingroup$ @cvgmt use AbsoluteThickness[.01] $\endgroup$
    – M.R.
    Oct 9, 2020 at 0:46
  • $\begingroup$ unfortunately this doesn't solve the prob $\endgroup$
    – Gouz
    Oct 9, 2020 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.