Results 1 to 8 of 8

Thread: 2017 Cars by Weight and Displacement example

Threaded View

  1. #1
    Senior Member
    Join Date
    Mar 2008
    Location
    Brighton, MI
    Posts
    686

    2017 Cars by Weight and Displacement example

    Until I figure out how to add images to the reddit forum, here is an example of the plot labeling I mentioned. User selectable and removable labels with pertinent data.Attachment 1328

    Done with:

    file='fsae_mi_2017_result.xls'

    [numeric,txt,raw]=xlsread(['C:\Users\BillCobb\downloads\' file],'Info','b4:h128');

    wgt=numeric(:,4);
    displ=numeric(:,2);
    cyl=numeric(:,1);
    team=txt(:,1);
    country=txt(:,2);

    f=figure('NumberTitle','off','Menubar','none','Nam e',[upper(file) '(Info)']);
    plot(displ,wgt,'ro')
    xlabel('Engine Displacement')
    ylabel('Weight (kg)')
    datalabel('on','k.',team)
    xlim([400 800])
    grid
    sidetext('BillCobb zzvyb6@yahoo.com')


    % f=figure('NumberTitle','off','Menubar','none','Nam e',[upper(file) '(Info)']);
    % [idx,label] = grp2idx(sort(country));
    % hist(idx,unique(idx));
    % set(gca,'xTickLabel',label);


    f=figure('NumberTitle','off','Menubar','none','Nam e',[upper(file) '(Info)']);
    plot(cyl,wgt,'ro')
    datalabel('on','k.',team)
    xlim([0 5])
    set(gca,'XTick',[ 1 2 3 4])
    grid
    xlabel('Number of Cylinders')
    ylabel('Weight (kg)')
    sidetext('BillCobb zzvyb6@yahoo.com')


    2017_MIS_wgt_disp.JPG2017_MIS_wgt_cyl.JPG
    Last edited by BillCobb; 12-13-2018 at 11:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts