- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想画一个闵可夫斯基图。
它包括两个不同的轴,每个系统一个,但它们并非都是正交的。有没有办法为一个非正交系统绘制一对轴?
最佳答案
这是使用 AxisArtist 的示例和 GridHelperCurveLinear , 修改自 here .
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.grid_helper_curvelinear import GridHelperCurveLinear
from mpl_toolkits.axisartist import Subplot
def curvelinear_test1(fig):
def tr(x, y):
x, y = np.asarray(x), np.asarray(y)
return .8*x+.2*y, .2*x + .8*y
def inv_tr(x,y):
x, y = np.asarray(x), np.asarray(y)
return 1.333*x + -.333*y, -.333*x + 1.333*y
grid_helper = GridHelperCurveLinear((tr, inv_tr))
ax1 = Subplot(fig, 1, 1, 1, grid_helper=grid_helper)
fig.add_subplot(ax1)
xx, yy = tr([3, 6], [5.0, 10.])
ax1.plot(xx, yy)
ax1.set_aspect(1.)
ax1.set_xlim(-10, 10.)
ax1.set_ylim(-10, 10.)
ax1.axis["t"]=ax1.new_floating_axis(0, 0.)
ax1.axis["t2"]=ax1.new_floating_axis(1, 0.)
ax1.grid(True)
fig = plt.figure()
curvelinear_test1(fig)
plt.show()
关于matplotlib - 在matplotlib中绘制非正交轴?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23581073/
我有一个由给定时刻的一组节点组成的图。该图可能会随着时间的推移而演变,即节点之间的关系以及节点本身可能会发生变化。 绘图必须是正交绘图。 我想画出图表的演变过程,即在不同的时刻绘制图表的图像,尝试从一
我有一个由 graphviz 工具制作的无向图(现在我正在使用 sfdp ): digraph structs { node [shape=Mrecord, URL="index_ne
我有一个世界地图的正交投影,在 D3 中并使用 TopoJSON。我通过调用此代码为每次加载数据的国家/地区着色。 地球在不停地旋转。 我的问题是,在旋转过程中我收到错误消息: 错误 >> 错误:在
我是 opencv 和 c++ 的新手,一直在尝试确定两条线是否几乎相互垂直/正交。有这个公式可以确定它们是否完全正交(m1*m2 = -1),而 m1 是第一个直线的斜率,m2 是第二个直线的斜率。
悬停时按钮会翻转但无法显示透视图。这就像动画的平面正交 View 。我使用的 perspective 属性有误吗? @import 'https://necolas.github.io/normali
我正在尝试使用高斯积分来近似函数的积分。 (更多信息在这里:http://austingwalters.com/gaussian-quadrature/)。第一个函数在区间 [-1,1] 上。第二个函
我在使用 opengl 绘制简单的 2d 纹理四边形时遇到了 z fighting 的一些问题。症状是两个物体以相同的速度移动,一个在另一个上面,但周期性地一个可以看穿另一个,反之亦然 - 有点像“闪
我正在尝试在背景图像(正交投影)顶部使用 Frustum 投影渲染一些网格。无论我做什么,背景图像始终位于场景顶部(隐藏网格)。 我尝试了一个小测试 - 当我用相同的投影矩阵渲染它们时 以正确的顺序
我是一名优秀的程序员,十分优秀!