2012-03-30 39 views
2

我想將ChartLabels放在BarChart下面,但是當我使用'Below'選項時,ChartLabels會被系統地切割。Mathematica - BarChart3D:如何正確顯示ChartLabels?

這裏是我的代碼&和數字:

data10000 = Import["results2_10000.dat"][[;; ;; 1]] 
{{0.315364, 564.876}, {4.7499, 10.4077}, {6.12522, 8.51407}, {1.26482, 
    55.5532}, {628.23, 1.58626}, {0.383874, 610.822}, {}} 

figure3D10000 = BarChart3D[{SetPrecision[data10000[[1]], 2], 
SetPrecision[data10000[[2]], 2], 
SetPrecision[data10000[[3]], 2], 
SetPrecision[data10000[[4]], 2], 
SetPrecision[data10000[[5]], 2], 
SetPrecision[data10000[[6]], 2] 
}, 
ChartLabels -> 
{Placed[{ 
    Text[Style["contiguous", 11]], 
    Text[Style["chunks(79,157)", 11]], 
    Text[Style["chunks(100,100)", 11]], 
    Text[Style["chunks(1000,1000)", 11]], 
    Text[Style["chunks(10000,1)", 11]], 
    Text[Style["chunks(1,10000)", 11]] 
    }, 
Below, 
Rotate[#, Pi/2.5] &], 
None 
}, 
LabelingFunction -> Above, 
ChartElementFunction -> "ProfileCube", 
ChartLegends -> {Placed[{ 
    Text[Style["line per line", 11]], 
    Text[Style["column per column", 11]] 
    }, 
Top] 
}, 
AxesLabel -> {None, None, Style["time"[s], FontSize -> 11]}, 
AxesStyle -> {None, None, {Directive[13], Thickness -> 0.004}}, 
PlotRange -> {All, All} 
] 

不幸的是,我是一個新的用戶我不能發佈的身影。但是,如果您測試此代碼,您會看到BarChart下的標籤幾乎不可見。

回答

1

一些改進與ImagePadding:

data10000 = {{0.315364, 564.876}, {4.7499, 10.4077}, {6.12522, 
    8.51407}, {1.26482, 55.5532}, {628.23, 1.58626}, {0.383874, 
    610.822}, {}} 

figure3D10000 = 
BarChart3D[{SetPrecision[data10000[[1]], 2], 
    SetPrecision[data10000[[2]], 2], SetPrecision[data10000[[3]], 2], 
    SetPrecision[data10000[[4]], 2], SetPrecision[data10000[[5]], 2], 
    SetPrecision[data10000[[6]], 2]}, 
    ChartLabels -> {Placed[{Text[Style["contiguous", 11]], 
     Text[Style["chunks(79,157)", 11]], 
     Text[Style["chunks(100,100)", 11]], 
     Text[Style["chunks(1000,1000)", 11]], 
     Text[Style["chunks(10000,1)", 11]], 
     Text[Style["chunks(1,10000)", 11]]}, Below, 
    Rotate[#, Pi/2.5] &], None}, LabelingFunction -> Above, 
    ChartElementFunction -> "ProfileCube", 
    ChartLegends -> {Placed[{Text[Style["line per line", 11]], 
     Text[Style["column per column", 11]]}, Top]}, 
    AxesLabel -> {None, None, Style["time [s]", FontSize -> 11]}, 
    AxesStyle -> {None, None, {Directive[13], Thickness -> 0.004}}, 
    PlotRange -> {All, All}, ImagePadding -> 110, ImageSize -> 600] 
+0

非常感謝克里斯。它解決了我的問題! – guillaume 2012-03-30 12:39:55