是否有人知道是否可以在图中旋转图例matplotlib
?我使用下面的代码制作了一个简单的图,并在绘画中编辑了图表以显示我想要的内容.
plt.plot([4,5,6], label = 'test')
ax = plt.gca()
ax.legend()
plt.show()
Run Code Online (Sandbox Code Playgroud)
我正在尝试在运行AVA测试时编译源文件(以及它们在node_modules中的依赖项).我已将AVA配置为要求babel-register
并继承我的.babelrc
文件,其中包含以下内容package.json
:
"ava": {
"require": "babel-register",
"babel": "inherit"
}
Run Code Online (Sandbox Code Playgroud)
这个在.babelrc
:
{
"presets": [ "es2015" ],
"ignore": false
}
Run Code Online (Sandbox Code Playgroud)
我有一个测试规范,用于导入源文件,该源文件从node_modules导入ES2015依赖项:
但是,在运行时ava
我看到:
/Users/me/code/esri-rollup-example/node_modules/capitalize-word/index.js:2
export default input => input.replace(regexp, match => match.charAt(0).toUpperCase() + match.substr(1));
^^^^^^
SyntaxError: Unexpected token export
Run Code Online (Sandbox Code Playgroud)
这告诉我源文件(src/app/utils.js
)确实是转换的,但它在node_modules(capitalize-string/index
)中的依赖性没有.
当我使用babel CLI时,源模块和依赖项都转换得很好,所以看起来它.babelrc
的"ignore": false
设置似乎没有传递给它babel-register
.我可以从babel文档中看到你可以显式传递一个忽略选项babel-register
,但我不知道如何从AVA配置中做到这一点.我甚至尝试在导入源文件的行之前将以下内容添加到我的测试文件中,但我仍然看到相同的错误:
require("babel-register")({
ignore: false
});
Run Code Online (Sandbox Code Playgroud)
我想我可以在测试前添加一个简单的步骤,但我想确保我不是首先错过了一些AVA或babel配置.
嗨,我正在通过Cordova(5.1.1)/ Phonegap构建iOS应用程序,但有一个我无法解决的问题。
一个基本的Ajax
电话抛出一个问题,SecurityError: DOM Exception 18
我尝试了所有有关白名单的技巧,但现在我迷路了。有谁可以帮助您?谢谢。
准备好设备后,我会执行以下操作:
var getUrl = 'http://shopplo.com/api/posts/radius/'+app.lat_min+'x'+app.lat_max+'x'+app.lng_min+'x'+app.lng_max+'';
//console.log(getUrl);
var getPosts = $.ajax({
method: 'GET',
url: getUrl,
dataType: 'JSON'
})
.done(function(e) {
console.log( e );
})
.fail(function(e) {
//console.log( "error");
$.each(e, function(key, element) {
console.log('key: ' + key + '\n' + 'value: ' + element);
});
})
.always(function() {
console.log( "complete" );
});
Run Code Online (Sandbox Code Playgroud)
getUrl是:http : //shopplo.com/api/posts/radius/37.11032230061141x73.11032230061141x-20.572796183027627x42.36447502674581
我得到:
2015-07-20 01:12:55.981 ShopploLight[779:568632] key: responseJSON :: value: undefined
2015-07-20 01:12:55.983 ShopploLight[779:568632] key: status :: value: …
Run Code Online (Sandbox Code Playgroud) 在最新版本的WordPress中,它使您有机会使用不同的主题查看您的网站的预览.您基本上只需点击主题,它就会占据屏幕并且您有机会激活或关闭它(并返回到前一个屏幕,该屏幕在后台显示为灰色).我已经看到最近在许多网站上使用的类似技术用于显示图像.
我想知道他们使用什么技术/代码来做这件事?
我的代码上有一个select2(jQuery插件),除了我选择项目的情况外,它正常工作.
价值是错误的.
形成:
<form id="Teste" method="get" action="">
<input type="hidden" id="e6" name="e6" class="select2" style="width: 600px;" />
<input type="submit" value="Send" />
</form>
Run Code Online (Sandbox Code Playgroud)
select2的输入 - 隐藏(远程数据需要) - 值:[Object]:
<input type="hidden" id="e6" name="e6" class="select2 select2-offscreen" style="width: 600px;" tabindex="-1" title="" value="[object Object]">
Run Code Online (Sandbox Code Playgroud)
Javascript用于实例select2:
function formatRes(item) {
return item.Text;
}
function formatSel(item) {
return item.Value;
}
$("#e6").select2({
placeholder: "Select your supplier",
minimumInputLength: 0,
id: function(data){return {id: data.id};},
allowClear: true,
ajax: {
url: "http://localhost:1396/List/_GetDropDownListSupplier",
dataType: 'jsonp',
quietMillis: 300,
data: function (term, page) {
return {
searchString: …
Run Code Online (Sandbox Code Playgroud) 我有两个heroku node.js应用程序,一个用于prod,一个用于dev,我还有一个具有dev和prod特定任务的Gruntfile.我知道你可以设置package.json来运行grunt作为npm的postinstall挂钩,但是你可以指定不同的任务来运行,具体取决于你所在的enviro吗?
这是我的package.json的相关部分到目前为止的样子:
"scripts": {
"postinstall": "./node_modules/grunt/bin/grunt default"
},
Run Code Online (Sandbox Code Playgroud)
如果NODE_ENV是生产等,我不想每次都运行grunt默认值,而是喜欢运行"grunt production".
这可能吗?