希望在绘制的图形之间添加垂直空间以允许X轴标签显示:
每个图形都需要有空间来显示当天,目前最后两个图形是唯一显示的图形,因为图形与它重叠.
同样好奇的是,我是否真的可以删除X轴的凹口标签,用于周四/周五标记的图形,即底部X轴是唯一显示的图形.对于Y轴也是如此,但只有左侧的图表显示了比例.
*遗憾的是,由于我没有足够的代表,我无法发布图片来展示这一点.
代码段:
import mathlib.pyplot as pyplot
fig = pyplot.figure()
ax1 = fig.add_subplot(4,2,1)
ax1.set_yscale('log')
ax2 = fig.add_subplot(4,2,2, sharex=ax1, sharey=ax1)
ax3 = fig.add_subplot(4,2,3, sharex=ax2, sharey=ax2)
ax4 = fig.add_subplot(4,2,4, sharex=ax3, sharey=ax3)
ax5 = fig.add_subplot(4,2,5, sharex=ax4, sharey=ax4)
ax6 = fig.add_subplot(4,2,6, sharex=ax5, sharey=ax5)
ax7 = fig.add_subplot(4,2,7, sharex=ax6, sharey=ax6)
ax1.plot(no_dict["Saturday"],'k.-',label='Saturday')
ax1.set_xlabel('Saturday')
ax1.axis([0,24,0,10000])
pyplot.suptitle('Title')
pyplot.xlabel('Hour in 24 Hour Format')
ax2.plot(no_dict["Sunday"],'b.-',label='Sunday')
ax2.set_xlabel('Sunday')
...
Run Code Online (Sandbox Code Playgroud)

我正在尝试编译几个WAR文件,所有这些都取决于一个常见的JAR模块.然而,在我的Gradle构建中,我似乎无法获得使用Java插件的"提供"之类的依赖项.
我的编译看起来像这样:
apply plugin: 'java'
configurations{
providedCompile
}
dependencies {
compile module("org.springframework.amqp:spring-amqp:${springAmqpVersion}")
compile module("org.slf4j:slf4j-api:${slf4jVersion}")
compile module("org.slf4j:slf4j-ext:${slf4jVersion}")
providedCompile "javax.servlet:servlet-api:${servletApiVersion}"
runtime module("org.slf4j:jcl-over-slf4j:${slf4jVersion}")
runtime module("org.slf4j:jul-to-slf4j:${slf4jVersion}")
runtime module("org.slf4j:log4j-over-slf4j:${slf4jVersion}")
sourceArchives module("org.springframework.amqp:spring-amqp:${springAmqpVersion}:sources")
sourceArchives module("javax.servlet:servlet-api:${servletApiVersion}:sources")
}
sourceSets {
main { compileClasspath += configurations.providedCompile }
}
Run Code Online (Sandbox Code Playgroud)
但是,最后一位是它获得异常的地方.我已经尝试在运行时依赖项扩展它之后将servlet-api(由Tomcat提供)添加到配置中,或者只是将其作为编译模块放入,然后将其从运行时依赖项中删除.
我尝试了几种不同的修改依赖关系的方法,最接近的结果是:
newRuntime = configurations.runtime.minus(configurations.providedCompile)
configurations.runtime = newRuntime
Run Code Online (Sandbox Code Playgroud)
然而,最后一点将生成具有适当依赖关系的变量newRuntime,但是当我尝试将变量重新分配回运行时配置时,它会抛出"找不到属性异常"
我在Gradle的错误跟踪上发现了很多关于这个确切问题的讨论:Gradle-784
然而,主要的导致是来自Spring,他使用Maven和他们的gradle构建,我不熟悉.
我在SO上找到的最有希望的链接,但不幸的是我无法让这些例子也能正常工作:SO提供 了Stack Overflow问题的注意事项:显示最有希望的一行:
//Include provided for compilation
sourceSets.main.compileClasspath += configurations.provided
Run Code Online (Sandbox Code Playgroud)
此行不会像其他尝试一样给出错误,但似乎提供的Compile(我提供的版本)依赖项实际上并未放在编译类路径上,因为尝试编译时会出现类路径错误.