Map Style in ChartLabel in Mathematica
ChartLabels -> Placed[{{Style["0", Bold, 18, FontFamily -> "Helvetica"]},
{Style["1", Bold, 18, FontFamily -> "Helvetica"]},
{Style["2", Bold, 18, FontFamily -> "Helvetica"]},
{Style["3", Bold, 18, FontFamily -> "Helvetica"]},
{Style["4", Bold, 18,
FontFamily -> "Helvetica"]}},
{{.1, .15}, {.3, .15}, {.5, .15}, {.7, .15},{.9, .15}}]
First, I am sorry this is even an embarass to myself,开发者_C百科 but I could not figure out how to use a function in there.
How can I make this tighter ?
I tried nesting a Switch unsuccessfully yet.
I'm interested to know what kind of chart you're creating with this.
Anyway, Placed
takes a third argument that can be applied to the labels, so you could use something like:
ChartLabels ->
Placed[
{"0", "1", "2", "3", "4"},
{{.1, .15}, {.3, .15}, {.5, .15}, {.7, .15}, {.9, .15}},
Style[#, Bold, 18, FontFamily -> "Helvetica"] &
]
Do you mean something like
ChartLabels -> Placed@@Transpose[Table[{
{Style[n[[1]], Bold, 18, FontFamily -> "Helvetica"]}, {n[[2]], .15}},
{n, Transpose[{ToString/@Range[0, 4], Range[.1, .9, .2]}]}]]
Another option is maybe to set the BaseStyle for the chart. Or maybe LabelingFunction.
精彩评论