1 / 13

UW CSE 190p Section

UW CSE 190p Section. 7 /26, Summer 2012 Dun-Yu Hsiao. Before We Start. Create and remember save every code and steps you try today! If you have any question about today’s material, email your report to TA. Outlines. Visualization: plot. Plot Basics. Line Color b : blue g : green

rupert
Download Presentation

UW CSE 190p Section

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao

  2. Before We Start • Create and remember save every code and steps you try today! • If you have any question about today’s material, email your report to TA.

  3. Outlines • Visualization: plot

  4. Plot Basics • Line • Color • b : blue • g : green • r : red • c : cyan • m : magenta • y : yellow • k : black • w : white • Width • Marker

  5. Plot Setting plt.plot(t, f(t), color=’r', linewidth=2.0) plt.setp(lines, color='r', linewidth=2.0) plt.setp(lines, 'color', 'r', 'linewidth', 2.0)

  6. Plot Basic Exercise • Plot (x-2)2-10, -10< x < 10, line color red, dashed line, line width 3.0 • Plot again using green triangular markers, step the marker by 1.5

  7. Plot Basics • Line graph • Bar graph • Scatter plot

  8. Figure Attribute • Axis • Grid • Label • Title • Figure • Multiple figures • Multiple plots in the same graph • Multiple graphs in the same figure, i.e., subplots

  9. Exercise • Scatter plot of random 100 points between x:[0,1] and y:[5,7] • Make the axis betweenx:[-0.5,1.5] and y:[4.5,7.5] • Add dotted grid, step by 0.5 • Add title as “Random Scatter”

  10. Legends, Labels, Decorations • Legend • Text • Annotation

  11. Exercise x = [1, 2, 3, 4, 5, 6] y1 = [1675, 2979, 4356, 3432, 6851, 5245] y2 = [3163, 4198, 7021, 2134, 2338, 4598] • Create figure, plot in two separate plots • Create a new figure, plot both in one • Add max annotations of y1 and y2 • Add legend, xlabel “Year”, ylabel ”Earning”

  12. Questions?

  13. Homework/Quiz Questions?

More Related