Graph BLT图形y轴标题不清楚

Graph BLT图形y轴标题不清楚,graph,tcl,Graph,Tcl,我找不到为什么Y轴标题“计数”看起来不清晰,而X轴标题“时间”看起来不错的原因 TCL代码: proc graphCreation {} \ { global backColor global btnColor global xtemp yBio yPart tempgraph blt::stripchart .tempgraph -width 625 -height 330 -background $backColor -plotbackground white -font bold

我找不到为什么Y轴标题“计数”看起来不清晰,而X轴标题“时间”看起来不错的原因

TCL代码:

proc graphCreation {} \
{
global backColor
global btnColor
global xtemp yBio yPart tempgraph

    blt::stripchart .tempgraph -width 625 -height 330 -background $backColor -plotbackground white -font boldFont
    set tempgraph 1

.tempgraph configure -borderwidth 0 \
         -leftmargin 0 \
         -rightmargin 0 \
         -plotborderwidth 0 \
         -plotpadx {0 0} \
         -plotpady {0 0}

.tempgraph legend configure -hide yes
.tempgraph grid configure -color gray \
                  -dashes 1 \
                  -minor 0 \
                  -hide 0

.tempgraph axis configure x -command FormatXLabel 
                    #-shiftby 1 \
                    -stepsize 2

proc FormatXLabel {widget x} {
    set xtemp  [expr round($x)]
    return [clock format $x -format "%H:%M:%S"]
}
# Bio
.tempgraph element create Bio -symbol {} -color red -linewidth 1 \
    -smooth linear 

.tempgraph axis configure y -title "Counts" 
.tempgraph axis configure x -title "Time"
}
这就是它的样子:


更新:我最终在图形旁边放置了一个简单的图像,替换了原生的y轴标签。在我的情况下,它看起来比原生的要好得多。这是一个相当微妙的问题。唉。BLT通过在屏幕外缓冲区中正常渲染文本,然后在将结果传输到屏幕之前逐像素旋转生成的图像来旋转文本。如果应用适当的缓存,这是一种非常快速的技术。(Tk 8.6在某些配置中使用类似的机制在画布上渲染旋转文本-那些不能直接绘制旋转文本的配置,如经典的X11字体渲染器-但使用更复杂的旋转算法。)

但是,必须假设缓冲区是有效的单色,并且任何不完全是背景色的像素都是前景。这意味着任何最初着色的像素(用于抗锯齿/亚像素渲染)在旋转后变为黑色。(如果仔细观察,也可以在旋转文本上看到“锯齿状物”。)

很难看,是吗

我能建议的唯一修复方法是运行Tk 8.6,将不带轴标题的图形嵌入Tk
画布中,并使用画布的旋转文本功能“手动”在标题上绘制。这是因为Tk的旋转文本代码功能更强;特别是,在任何进行抗锯齿文本渲染的平台上,它都会将旋转的字形渲染移动到系统字体引擎本身中,这意味着抗锯齿在旋转后发生,并且文本看起来正确

(披露:我用Tk编写了旋转文本代码。你不会相信我在各种平台上发现的错误,尤其是累积坐标舍入错误。)


解决方法是使用非常薄的字体。或者在系统级禁用字体抗锯齿…

旋转代码不可能返回到Tk 8.5;这是一个很大的工作,涉及了很多内部API。感谢您提供的信息,我最终要做的是使用一个简单的图像并将其放在图形旁边,我认为这是最简单的方法,但希望它能确保我是否遗漏了一些内容