如何使用pyplot自动缩放动画图?

时间:2018-09-05 21:53:06

标签: python animation matplotlib

我有以下代码可以生成动画情节:

let instanceA = null;
let instanceB = null;

class A {
  constructor(options) {
    this.options = options;
  	
    if (instanceA === null) {
     
      	instanceA = this;
    }
    if(this.constructor.name !== "A"){
    	return this;
    }
    
    return instanceA;
  }
  
  method1(){
    console.log(this.constructor.name)
  }
}

class B extends A {
  constructor(options) {
    if (instanceB === null) {
      super(options)
      instanceB = this;
    }
    return instanceB;
  }
}

const a = new A({
  i_am_a: "aaaaaa"
});a

const b = new B({
  i_am_b: "bbbbbb"
}) 
const c = new A({
  i_am_c: "ccccc"
});
const d = new B({
  i_am_d: "ddddd"
}) 
console.log(a.options)
console.log(b.options)
console.log(c.options)
console.log(d.options)
a.method1();
b.method1();
c.method1();
d.method1();

我如何才能使图缩放以适​​合数据?我希望轴和刻度自动调整。

0 个答案:

没有答案