How To Draw Well in Paper

Slides:



Advertisements
Similar presentations
Objectives Build and modify an organization chart.
Advertisements

2D Plots 1 ENGR 1181 MATLAB 12.
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Digital Image Processing Lecture11: Histogram Processing.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Lecture 9 Plotting in 2-D Plotting in 2-D, Plotting Multiple Curves, Plotting with Figures, Plot Settings, Scaling, Legends © 2007 Daniel Valentine. All.
Academic Computing Services 2010 Microsoft ® Office Visio ® 2007 Training Get to know Visio.
 1 Basic Data Visualization. IPython An interactive shell to execute Python script. Run from a shell; ipython 2.
Microsoft Office Illustrated Fundamentals
Adding Free Text to the Chart. Activating the drawing tool bar Adding Free Text to the Chart, Slide 2Copyright © 2004, Jim Schwab, University of Texas.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
PLOTS AND FIGURES DAVID COOPER SUMMER Plots One of the primary uses for MATLAB is to be able to create publication quality figures from you data.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Integrating Graphics, Charts, Tables Into your technical writing documents.
Copyright © 2001 by Wiley. All rights reserved. Chapter 11: Using Visual Basic to Create Graphics Scale Method Line Method Line Charts Bar Charts Pie Charts.
Microsoft ® Office Excel 2007 Working with Charts.
1. Chapter 15 Creating Charts 3 Charting Data in Word A chart or graph presents data visually. A chart depicts numeric data in a graphical format. If.
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
Create a Pie Chart Create Pie Chart, Slide 1Copyright © 2004, Jim Schwab, University of Texas at Austin A pie chart is useful for.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
Introduction to Engineering MATLAB – 9 Plotting - 2 Agenda Formatting plots.
MATLAB ® for Engineers, Holly Moore Fourth Edition, Global Edition © Pearson Education Limited 2015 All rights reserved. Figure 5.1 Simple Plot of Time.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
Integrating Graphics, Illustrations, Figures, Charts.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
Introducing Tim Sheerman-Chase This work is licensed under a Creative Commons Attribution 3.0 Unported License 28 th Sept 2011.
CS 5163 Introduction to Data Science
Reading and Writing Image Files
Visualizing your data effectively
Esther Roughsedge & Vicky Avila BSPS conference 2017
CSS Layouts: Grouping Elements
Working with Charts © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Inserting and Working with Images
Lecture 25.
Excel Part 4 Working with Charts and Graphics
Levels of Organization Ecology Flow
IPYTHON AND MATPLOTLIB Python for computational science
Ch3 Graphics Overview of Plotting Editing Plots
Lecture 25: Exploring data
Two-Dimensional Plots
Excel Part 4 Working with Charts and Graphics
Enhancing a Document Part 1
Word Lesson 6 Working with Graphics
Net 222: Communications and networks fundamentals (Practical Part)
Proposal: Preliminary Results and Discussion
Net 222: Communications and networks fundamentals (Practical Part)
Signature: Microsoft Word 2003
Microsoft Excel Illustrated
Enhancing a Document Part 1
Force and Motion (Basic) Half-circle picture with accent arcs
Microsoft Office Illustrated Introductory, Windows XP Edition
INTRODUCTION TO SGPLOT Zahir Raihan OVERVIEW  ODS Graphics  SGPLOT overview  Plot Content  High value plot statements  High value plot options 
CSc4730/6730 Scientific Visualization
Building Worksheet Charts
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Python plotting curves chapter 10_5
Matplotlib.
Levels of Organization Ecology Flow
PYTHON Graphs Prof. Muhammad Saeed.
Plotting Signals in MATLAB
Using Word to Write the Story of Your Life
Using Charts in a Presentation
Matplotlib and Pandas
Excel Part 4 Working with Charts and Graphics
Microsoft Office Illustrated Fundamentals
Map Template Bio 493, Fall 2009 Feature Colors Default Font: Arial
Microsoft Office Illustrated Fundamentals
Presentation transcript:

How To Draw Well in Paper Ye Yu & Hui Chen Oct 2016

Outline Groups of Different Softwares One Example More Examples Data plotting Schematic diagram Data Visualization One Example Matplotlib More Examples

Data plotting Software Tools Disadvantages Advantages 1 Matlab, Mathematica Easy to learn Multiple types of image (2D, 3D) Lack of beauty Zigzag shape 2 Python LIB -Matplotlib Any type of image Contain TeX math syntax Open Source Difficult to handle 3D image 3 LaTex -Tikz Multiple types of image Good interaction between latex document s Overview of different type of drawing softwares Next Application Examples

Matlab Basic function to draw 2D 3D images Zigzag shape

-Matplotlib

Overall interaction between LaTeX documents Resources and codes community http://tex.stackexchange.com/ Scatter Curve Logic Structure Christmas fractal tree Animated definite integral

Schematic diagram Software Tools Disadvantages Advantages 4 Metapost Schematic diagram , Vector diagram Precisely controlled by code —— 5 Visio Schematic diagram , Flow chart No programming 6 Blender 3D Rendering Open Source 3D creation

Metapost Book cover Mathematic model Visio Communication model Flow Chart Blender Lorentzian line molecule

Data Visualization Software Tools Disadvantages Advantages 7 R -ggplot2 Statistics data visualization —— 8 Paraview variety of data formats and display methods 9 Tecplot Convers a large number of data into an easy understandable picture

Airflow of the racing car Global temperature distribution Airflow of the aircraft wing Offshore drilling platform

Summary Software Tools Disadvantages Advantages 1 Lack of beauty 2 Matlab, Mathematica Easy to learn Multiple types of image (2D, 3D) Lack of beauty 2 Python LIB -Matplotlib Any type of image Contain TeX math syntax Difficult to handle 3 Metapost Sketch Map, Vector diagram Precisely controlled —— 4 Blender Open Source 3D creation 5 R -ggplot2 Statistics data visualization 6 Visio Schematic diagram , Flow chart 7 LaTex-Tikz Multiple types of image Difficult 8 Paraview Variety of data formats and display methods 9 Tecplot Convers a large number of data into an easy understandable picture

Outline Groups of Different Softwares One Example More Examples Data plotting Schematic diagram Data Visualization One Example Matplotlib More Examples

One Example PYTHON More delicate/smooth matplotlib

Anaconda Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes over 195 of the most popular Python packages for science, math, engineering, data analysis.

IDE: Spyder

Function Figure Transparency Alpha:0~1 import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2 * np.pi, 100) y1 = np.sin(x) y2 = np.sin(3 * x) plt.fill(x, y1, 'b', x, y2, 'r', alpha=0.3) plt.show()

Scatter Figure plt.scatter(x, y, s=area, alpha=0.5)

3D Figure Rstride: line on y direction Cstride: line on the x direction 3D Figure ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3) cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm) cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm) cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)

If color=V, color will be opposite Vector Field Figure plt.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn) plt.colorbar()

Networking plt.triplot(x, y, triangles, 'go-') plt.title('triplot of user-specified triangulation') plt.xlabel('Longitude (degrees)') plt.ylabel('Latitude (degrees)')

Polarization Figure ax = plt.subplot(111, polar=True) Bottom is the inside start point of each sector Polarization Figure ax = plt.subplot(111, polar=True) bars = ax.bar(theta, radii, width=width, bottom=0.0)

Pie Charts n = 20 Z = np.random.uniform(0,1,n) pie(Z) show()

Scatter and Histogram scatter() hist()

Plotly makes interactive, publication-quality graphs online http://nbviewer.jupyter.org/github/plotly/python-user-guide/blob/master/s0_getting-started/s0_getting-started.ipynb

comic Xkcd Style http://jakevdp.github.io/blog/2013/07/10/XKCD-plots-in-matplotlib/ plt.xkcd()

Steps To Make

Default Figure X = np.linspace(-np.pi, np.pi,256,endpoint=True) C,S = np.cos(X), np.sin(X) plot(X,C) plot(X,S) show()

Change Color and Width figure(figsize=(10,6), dpi=80) plot(X, C, color="blue", linewidth=2.5, linestyle="-") plot(X, S, color="red", linewidth=2.5, linestyle="-") First of all, we want blue and sine cosine is is red, their lines are slightly thicker. We will also change the image size slightly to make it a bit wider.

Set Boundary xlim(X.min()*1.1, X.max()*1.1) ylim(C.min()*1.1, C.max()*1.1) The current image boundary is a bit too tight a little, and we want to set aside a little space to make data points more clearly.

Set Tick Labels xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi], [r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$']) yticks([-1, 0, +1], [r'$-1$', r'$0$', r'$+1$']) The current scale is not ideal, because they don't show is the cosine values we are interested in (+ / - + / - PI, PI / 2). We will change them let them explicitly only those values.

Moving Spines ax = gca() ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.spines['bottom'].set_position(('data',0)) ax.yaxis.set_ticks_position('left') ax.spines['left'].set_position(('data',0)) Spines are the lines connecting the axis tick marks and noting the boundaries of the data area. They can be placed at arbitrary positions and until now, they were on the border of the axis. We'll change that since we want to have them in the middle. Since there are four of them (top/bottom/left/right), we'll discard the top and right by setting their color to none and we'll move the bottom and left ones to coordinate 0 in data space coordinates.

Add a Legend plot(X, C, color="blue", linewidth=2.5, linestyle="-", label="cosine") plot(X, S, color="red", linewidth=2.5, linestyle="-", label="sine") legend(loc='upper left') Let's add a legend in the upper left corner. This only requires adding the keyword argument label (that will be used in the legend box) to the plot commands.

Annotate Some Points t = 2*np.pi/3 plt.plot([t,t],[0,np.cos(t)], color ='blue', linewidth=1.5, linestyle="--") plt.scatter([t,],[np.cos(t),], 50, color ='blue') plt.annotate(r'$\sin(\frac{2\pi}{3})=\frac{\sqrt{3}}{2}$', xy=(t, np.sin(t)), xycoords='data', xytext=(+10, +30), textcoords='offset points', fontsize=16, arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2")) plt.plot([t,t],[0,np.sin(t)], color ='red', linewidth=1.5, linestyle="--") plt.scatter([t,],[np.sin(t),], 50, color ='red') plt.annotate(r'$\cos(\frac{2\pi}{3})=-\frac{1}{2}$', xy=(t, np.cos(t)), xycoords='data', xytext=(-90, -50), textcoords='offset points', fontsize=16, Let's annotate some interesting points using the annotate command. We chose the 2π/3 value and we want to annotate both the sine and the cosine. We'll first draw a marker on the curve as well as a straight dotted line. Then, we'll use the annotate command to display some text with an arrow. latex

Devil Is In The Details for label in ax.get_xticklabels() + ax.get_yticklabels(): label.set_fontsize(16) label.set_bbox(dict(facecolor='white', edgecolor='None', alpha=0.65 )) The tick labels are now hardly visible because of the blue and red lines. We can make them bigger and we can also adjust their properties such that they'll be rendered on a semi-transparent white background. This will allow us to see both the data and the labels.

Outline Groups of Different Softwares One Example More Examples Data plotting Schematic diagram Data Visualization One Example Matplotlib More Examples

Reference ‘How to draw beautiful illustrations in papers’, [Online]Available:  https://www.zhihu.com/question/21664179?from=timeline&isappinstalled=1 (Oct 5, 2016) More Examples: http://matplotlib.org/gallery.html

60