Mathematica中文论坛-非官方

标题: 豆粑粑 matlab pareto plot show text [打印本页]

作者: meatball1982    时间: 2017-9-6 20:55
标题: 豆粑粑 matlab pareto plot show text
This is a new plot function. The outputs are two kinds of figure handles.
show the text.



  1. clear all
  2. clc
  3. clf

  4. y = [90,75,30,60,52,43,3,1,2];
  5. % figure
  6. h = pareto(y);

  7. h_bar  = h(1);
  8. h_lin  = h(2);


  9. y_bar = get(h_bar,'YData');
  10. y_lin = get(h_lin,'YData');

  11. y_plot = y_lin./y_lin(end);

  12. n_plot = sum(y_plot < 0.95) + 1;

  13. hold on
  14. for i = 1:n_plot
  15.     text(i,y_lin(i),mat2str(floor(1000*y_plot(i))/1000))
  16. end

  17. h=gcf;
  18. fi_na=['./fig_with_text'];
  19. fun_work_li_035_myfig_out(h,fi_na,3);  
复制代码







欢迎光临 Mathematica中文论坛-非官方 (http://ilovemathematica.com/) Powered by Discuz! X3.2