标签: figure

在MATLAB中告诉imagesc使用特定的数字

我得到的不仅仅是......有点慌张......试图做一些应该是非常非常简单的任务.

我想用一个特定的数字,比如图(3)来做imagesc.所以在我的代码的开头,我总是这样做:

f3 = figure(3); 
a3 = gca;
Run Code Online (Sandbox Code Playgroud)

然后,我得到一些任意大小的矩阵数据.假设我data的大小为231 x 322.现在,我想告诉MATLAB,执行imagesc(data),但是在图(3)中.

我怎么做??imagesc没有采取数字或轴处理,这变得非常非常令人沮丧...谢谢!

matlab plot image figure matlab-figure

1
推荐指数
1
解决办法
1926
查看次数

如何在matlab中设置沿X轴的刻度数?

我在 Matlab 中沿 X 轴设置适当的刻度数时遇到问题。如下所示,我在 中将数字设置为 2 ha.XTicksNumber=2,但它仍然绘制为 10。

nSites = 2;

ha = tight_subplot(nSites,1,[.01 .01],[.1 .1],[.1 .1]);
display(ha);
for ii = 1:nSites; 
    axes(ha(ii));
    xData=linspace(1,100,90); 
    plot(xData);
    if ii~=nSites
        set(ha,'XTickLabel','');
    else
        set(ha,'XTickLabel','');
        ha.XTicksNumber=2;
        ha.XTick = linspace(1,90,55);
        datetick('x','mm/dd','keepticks');
    end 
end
Run Code Online (Sandbox Code Playgroud)

上面的代码是可以重现的。谢谢你的帮助!

我最终想要的是带有日期的 x 轴,但我希望能够

1) 设置沿 x 轴的日期数或 2) 设置任意两个日期之间的间隔。

有人知道怎么做吗?

matlab plot figure matlab-figure

1
推荐指数
1
解决办法
9447
查看次数

如何并排添加两个图形,并在每个图形上插入标题?

在Word中,我可以并排添加两个图形,但是,当我向每个图形标题插入标题时,图形编号不会改变,它们都具有相同的图形编号。我怎么解决这个问题?

ms-word caption figure

1
推荐指数
1
解决办法
1万
查看次数

在元素的两侧平均分配溢出文本

我遇到了以下问题:我得到了一个<figure>,它<figcaption>可能会溢出<figure>. 你可以在下面的小提琴中看到:

body{
  display:flex;
  justify-content:center;
  align-items:center;
}
figure{
  width:300px;
  height:500px;
}
img{
  width:100%;
}
figcaption{
  position:relative;
  top:-50px;
  display:inline-block;
  font-size:3em;
  white-space:nowrap;
  text-align:center;
  font-weight:bold;
  width:100%;
}
Run Code Online (Sandbox Code Playgroud)
<figure>
<img src="https://www.zooroyal.de/magazin/wp-content/uploads/2017/03/Golden-Retriever-760x560.jpg">
<figcaption>Golden Retriever</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)

我想要实现的是,<figure>无论文本是否比图形宽,文本仍以 为中心。

我想不出可能的解决方案。有谁知道实现这一目标的方法?请不要使用 JavaScript。

html css text overflow figure

1
推荐指数
1
解决办法
912
查看次数

将 matplotlib 图中的图旋转 90 度

我正在尝试将 matplotlib 图内的绘图旋转 90 度。我发现这篇文章,但它使用 pyplot 并且我使用简单的绘图,因此不起作用,而且他没有解释旋转 pyplot 的代码,但提到转换属性也可以用于旋转简单的绘图。我尝试在网上搜索转换教程,但无法理解这个概念。

这是我的代码片段

from matplotlib.figure import Figure
import numpy

# random data
data = numpy.random.randn(100)

# making figure on which plot will be draw
fig = Figure(figsize=(11, 8),dpi=100)
# adding plot to figure
plot1 = fig.add_subplot(111)
# plotting values
plot1.plot(data)

# saving figure for later use
fig.savefig("graph.jpeg")

Run Code Online (Sandbox Code Playgroud)

它产生以下结果;

电流输出

但我想要这样的输出;

所需输出

python matplotlib rotation figure

1
推荐指数
1
解决办法
4819
查看次数

<figure>内容高度增加4px

我正在尝试在figure标签内添加一个图像,但它在图像下留下了一个小的4px空间,这在添加边框时非常明显figure.我无法设置宽度来 figure标记,因为在渲染html时图像的宽度是未知的.

http://codepen.io/shahalpk/pen/cltAn

html css html5 figure

0
推荐指数
1
解决办法
722
查看次数

MATLAB图 - 在绘图之前过滤数据

我有一个90x2矩阵a,其中a(:,1)是x,而a(:,2)是y.

我想只绘制y大于BOOM的值.我怎样才能做到这一点?

目前我有

plot(a(:,1),a(:,2));
Run Code Online (Sandbox Code Playgroud)

还有一件事,我怎样才能完整显示数字num*10^4呢?

matlab figure matlab-figure

0
推荐指数
1
解决办法
45
查看次数

为什么matlab跳过标签的下半部分?

这是一个非常直观的代码,用于使用imagesc命令以缩放颜色显示矩阵.问题是最终数字标签错误并且没有显示标签的下半部分(应该是从1到21,但是从1到10)

figure;
imagesc(magic(21));
set(gca,'XTickLabel',{'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21'})
set(gca,'YTickLabel',{'1' '2' '3' '4' '5' '6' '7' '8' '9' '10' '11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21'})
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我正在使用Ubuntu 16.04和Matlab 2016b.

matlab figure matlab-figure

0
推荐指数
1
解决办法
47
查看次数

两行 matplotib 动画

我正在尝试使用两条线在同一图中绘制带有动画的 x、y 和 x、z 的动画图表,但我没有成功。你能帮助我吗?

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation


x = np.arange(130, 190, 1)
y = 97.928 * np.exp(- np.exp(-  0.1416 *( x - 146.1 )))
z = 96.9684 * np.exp(- np.exp(-0.1530*( x - 144.4)))

fig, ax = plt.subplots()
line, = ax.plot(x, y, color = "r")

def update(num, x, y, line):
     line.set_data(x[:num], y[:num])
     line.axes.axis([130, 200, 0, 110])
     return line,


 ani = animation.FuncAnimation(fig, update, len(x), fargs=[x, y, line],
                      interval=295, blit=True)


  ax.set_xlabel('Age (day)')
  ax.set_ylabel('EO …
Run Code Online (Sandbox Code Playgroud)

python matplotlib figure

0
推荐指数
1
解决办法
5207
查看次数

标签 统计

figure ×9

matlab ×4

matlab-figure ×4

css ×2

html ×2

matplotlib ×2

plot ×2

python ×2

caption ×1

html5 ×1

image ×1

ms-word ×1

overflow ×1

rotation ×1

text ×1