Mathematica:直方图中不需要的垂直线

发布于 2025-01-05 01:53:54 字数 696 浏览 4 评论 0原文

当将直方图的绘图范围从“自动”更改为超出自动计算的绘图范围的绘图范围时,Mathematica 会绘制一条我无法摆脱的不需要的水平线(请参见值 -4 处的右侧直方图)。有人对这个问题有建议吗?

我在 Mac OS 10.7.2 上运行 Mathematica V.8.0.1.0。

In[1099]:=

data = {-1.2056, -1.46192, -1.30053, -2.52879, -0.99636, -1.73904, -1.164,
-1.83398,-0.97505, -0.503256, -0.63802, -0.785963, -0.711821, -0.820439, -1.8699,
-3.9659, -1.4456, -1.67021, -1.42009, -2.5644, -1.45002, -1.27806, -1.66529,
-1.67073, -3.31102, -3.38638};

HistogramLeft=Histogram[data, PlotRange -> Automatic]

HistogramRight=Histogram[data, PlotRange -> {-8, 0}]

自动绘图范围 单独绘图范围

When changing the plot range of a histogram from Automatic to a plot range which exceeds the automatically calculated plot range, Mathematica draws an unwanted horizontal line which I cannot get rid of (see right histogram at value -4). Does anyone have a suggestion on that issue?

I'm running Mathematica V.8.0.1.0 on Mac OS 10.7.2.

In[1099]:=

data = {-1.2056, -1.46192, -1.30053, -2.52879, -0.99636, -1.73904, -1.164,
-1.83398,-0.97505, -0.503256, -0.63802, -0.785963, -0.711821, -0.820439, -1.8699,
-3.9659, -1.4456, -1.67021, -1.42009, -2.5644, -1.45002, -1.27806, -1.66529,
-1.67073, -3.31102, -3.38638};

HistogramLeft=Histogram[data, PlotRange -> Automatic]

HistogramRight=Histogram[data, PlotRange -> {-8, 0}]

automatic plot range
individual plot range

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

西瑶 2025-01-12 01:53:54

看起来您正在使用 Frame -> {{True, False}, {True, False}} (或类似的东西。)如果是这种情况,您可以使用 Axes->False 完全关闭法线轴。

It looks like you're using Frame -> {{True, False}, {True, False}} (or something similar.) If that's the case, you can turn off the normal axes entirely with Axes->False.

饮惑 2025-01-12 01:53:54

查看选项 AxesOrigin。

HistogramRight =  Histogram[data, PlotRange -> {-8, 0}, BarOrigin -> Left,  AxesOrigin -> {-8, 0}]

Look at the option AxesOrigin.

HistogramRight =  Histogram[data, PlotRange -> {-8, 0}, BarOrigin -> Left,  AxesOrigin -> {-8, 0}]
余厌 2025-01-12 01:53:54

如果我明白你想要什么,我想这很容易。

顺便

HistogramRight = 
 Histogram[data, PlotRange -> {-8, 0}, BarOrigin -> Left, 
 PlotLabel -> Left, Axes -> {False, True}]

说一下,Mathematica 有一个新的堆栈交换,位于 https://mathematica.stackexchange.com/

If I understand what you want, this is pretty easy, I think.

Try

HistogramRight = 
 Histogram[data, PlotRange -> {-8, 0}, BarOrigin -> Left, 
 PlotLabel -> Left, Axes -> {False, True}]

By the way, there is a new stack exchange for Mathematica at https://mathematica.stackexchange.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文