图形重新缩放后条形图和彩色图轴是错误的

问题描述 投票:0回答:0

使用 Octave 7.1.0,我想使用

pcolor()
绘制密度图,使用
bar()
函数绘制条形图。然后我希望轴的范围从我的代码中预先计算的值开始。这是代码示例。

clc
clear all
close all

load bins.txt;  % 400x151 matrix for bins components
load t_inp.txt; % 1x400 vector for time samples

% Bins
edges = [-0.25:0.01:1.25];
centers = edges + 0.005;

% Axis range I want to zoom on
timeAxis = [0 t_inp(end)];
voltageAxis = [-0.2 1.20];

figure(1)
% pcolor map
subplot(2,2,1)
hold on
title('Eye Diagram - probability density')
pcolor(t_inp, centers', bins');
shading interp;
axis manual
ylim(voltageAxis)
xlim(timeAxis)
hold off
% bar graph
subplot(2,2,3)
hold on
title('Jitter histogram, on transitions')
bar(t_inp, bins(:, round(length(centers)/2)))
axis manual
xlim(timeAxis)
ylabel('Count')
hold off

当图形第一次出现时,子图 1 和 3 都有右轴。但是,当我放大或重新缩放整个图形时,轴就会丢失 (see this picture).

我的最终目标是让彩色地图和条形图都具有指定的 x 轴值和正确的缩放比例,这取决于用户对图形执行的缩放比例。

我原以为使用轴手动命令即使在图形缩放比例发生变化后也能保持轴缩放。我尝试使用

xlim
/
ylim
axis
功能以不同的方式设置轴但没有成功。

我发现的一件事是,每当我在不指定 x 向量的情况下绘制颜色图或条形图时,我都不会得到这个“重新缩放错误”。

也许这是 Octave 中的一个已知错误?有解决办法吗?

bar-chart octave matlab-figure axis colormap
© www.soinside.com 2019 - 2024. All rights reserved.