dalist = {901, 503, 522, 1305}
cogColors = {RGBColor[0, 0, 1], RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[1, 1, 0]}
BarChart[dalist, ChartStyle -> cogColors]
我們可以在BarChart中減少Mathematica中Bar的寬度嗎?
是否有可能減少條寬度?
dalist = {901, 503, 522, 1305}
cogColors = {RGBColor[0, 0, 1], RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[1, 1, 0]}
BarChart[dalist, ChartStyle -> cogColors]
我們可以在BarChart中減少Mathematica中Bar的寬度嗎?
是否有可能減少條寬度?
BARCHART不打算這樣做。您只能更改間距。
使用RectangleChart代替,如果你需要更精細的控制:
RectangleChart[{{{1, 1}, {1, 1}, {1, 1}}, {{2, 2}, {2, 2}, {2, 2}}}]
而不是更改條形圖寬度,可以增加條形間距。
BarChart[dalist, ChartStyle -> cogColors, BarSpacing -> 1]
見海克的回答我earlier question。您需要使用RectangleChart
。如果要保持條形中心之間的恆定距離,以便條形加間距佔據恆定的空間,則可以使用ChartElementFunction
選項和輔助功能,如Heike的答案中所示。 (這也可以做你想用的東西BarChart
,但我仍然推薦RectangleChart
。)
我可能會錯過這一點,但不能只是改變縱橫比嗎?
BarChart[dalist, ChartStyle -> cogColors, AspectRatio -> 3, ImageSize -> 120]
真棒,謝謝! – 500
upvoters,請給予好評的其他問題海克的回答也一樣,如果你還沒有 – Verbeia