1
$\begingroup$

I'm trying to build a BarChart off of a table of discrete data. I would like to use ScalingFunctions. Not working. Here is my code:

StepPyramid04 = BarChart[{WDscrt4},
  ChartElementFunction->"ObliqueRectangle",
  ScalingFunctions->{"Log2",None},
  ChartStyle->{Red,Red,Red,Green,Green,Green,Green,Green,Green,Green,Green,Green,Green,Green,Green,Green,Blue,Blue,Blue,Blue},
  ChartLabels->{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"},
  AspectRatio->2/\[Pi],
  GridLines->Automatic,
  BarSpacing->Automatic,
  AxesLabel->Automatic
] 

My error message reads:

Visualization`Utilities`ScalingDump`mhead::sclfn: The scaling function {Log2,None} cannot 
be used to scale coordinates. 

Advice? Suggestions?

$\endgroup$
2
  • 3
    $\begingroup$ Why not just ScalingFunctions -> "Log2"? $\endgroup$ Nov 9 '20 at 23:56
  • 4
    $\begingroup$ OKCarl, may I suggest that you revisit your 13 questions and see if any answers are worth accepting/upvoting? $\endgroup$
    – kglr
    Nov 10 '20 at 0:27
5
$\begingroup$

For two dimensional functions,

ScalingFunctions -> "Log2"

is equivalent to

ScalingFunctions -> {None, "Log2"}

In BarChart, though, this is not the case. BarChart effectively has only one axis, used to measure the bar heights with. So, using either

ScalingFunctions -> {None, "Log2"}

or

ScalingFunctions -> {"Log2", None}

will generate that message.

ScalingFunctions -> {"Log2"}

works, though.

$\endgroup$
2
  • $\begingroup$ Thank you Mister rcollyer. Your last option works. $\endgroup$
    – OKCarl
    Nov 11 '20 at 1:07
  • 2
    $\begingroup$ @OKCarl this site's "currency" is upvotes and accepted answers. The accepted answers, in particular, are needed to highlight the work, presenting it to others as useful/canonical. Yet, for none of your questions have you marked any of the answers as accepted, despite you comment, above. Please, if you find them useful, mark the best as accepted. $\endgroup$
    – rcollyer
    Nov 11 '20 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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