如何在Matlab中修改图表轴?

时间:2018-07-22 09:50:26

标签: matlab

是否可以在matlab的XData轴中放置字符而不是数字? 例如在此图表中, simple chart

我想用1 2 3替换X轴上的string 1 string 2 string 3

我的代码是

a=bardata ;
b=barerror ;
ctrs = 1:3;
data = a;
figure(1)
hBar = bar(ctrs, data);
markers = {'x','o','^'};
ctr = [];
ydt = [];
for k1 = 1:size(a,2)
    ctr(k1,:) = bsxfun(@plus, hBar(1).XData, [hBar(k1).XOffset]');
    ydt(k1,:) = hBar(k1).YData;
end
hold on
    errorbar(ctr', ydt', b, '.r')
    legend({'Version 1', 'Version 2'}, 'location', 'northeast');
hold off

1 个答案:

答案 0 :(得分:0)

尝试一下:

require('./bootstrap');

window.Vue = require('vue');

import VueRouter from 'vue-router'

Vue.use(VueRouter)

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

Vue.component('home', require('./components/Home.vue'));


let buy = require('./components/Buy.vue');
let home = require('./components/Home.vue');
let sell = require('./components/Sell.vue');
let wallet = require('./components/Wallet.vue');


const routes = [{
        path: '/',
        component: home
    },
    {
        path: '/buy',
        component: buy
    },
    {
        path: '/sell',
        component: sell
    },
    {
        path: '/wallet',
        component: wallet
    }

]

const router = ({
    mode: 'history',
    routes
})

const app = new Vue({
    el: '#app',
    router
});

xticks基本上告诉将刻度线放在何处,而xticklabel是不言自明的。

如果您需要有关标签的更多信息: https://www.mathworks.com/help/matlab/ref/xticklabels.html