• No results found

Good Scientific Visualization Practices + Python

N/A
N/A
Protected

Academic year: 2021

Share "Good Scientific Visualization Practices + Python"

Copied!
51
0
0

Loading.... (view fulltext now)

Full text

(1)

Good Scientific Visualization Practices + Python

Kristen Thyng

Python in Geosciences

September 19, 2013

(2)

Overview of Bad Plotting

Outline

1

Overview of Bad Plotting

2

Perceptually-based colormaps

3

Matplotlib Tools

(3)

Overview of Bad Plotting

There are lots of bad plots out there

Using 3D when unnecessary

http://www.engadget.com/2008/01/15/live-from-macworld-2008-steve-jobs-keynote/

(4)

Overview of Bad Plotting

There are lots of bad plots out there

What is the dominant feature of this plot?

(5)

Overview of Bad Plotting

There are lots of bad plots out there

Inconsistent representations

http://www-personal.umich.edu/ jpboyd/sciviz 1 graphbadly.pdf

(6)

Overview of Bad Plotting

There are lots of bad plots out there

Unintuitive representation

(7)

Overview of Bad Plotting

There are lots of bad plots out there

Chart junk

http://en.wikipedia.org/wiki/File:Chartjunk-example.svg, Tufte, Edward R. (1983). The Visual Display of Quantitative Information. Cheshire, CT: Graphics Press.

(8)

Overview of Bad Plotting

Goals in Visualization

Honestly present the information - no

cheating!

Clear presentation - nothing

unnecessary

Label axes, units, etc, with large

lettering

Intuitive, consistent markers/coloring

Give context

(9)

Overview of Bad Plotting

Better plots

Using 3D when unnecessary

http://www.engadget.com/2008/01/15/live-from-macworld-2008-steve-jobs-keynote/

(10)

Overview of Bad Plotting

Better plots

Better presentation, though pie charts not great

http://www.quora.com/Data-Visualization/What-should-everyone-know-about-making-good-charts-and-graphs-to-represent-data

(11)

Overview of Bad Plotting

Better plots

What is the dominant feature of this plot?

http://www-personal.umich.edu/ jpboyd/sciviz 1 graphbadly.pdf

(12)

Overview of Bad Plotting

Better plots

Simpler is often better

(13)

Overview of Bad Plotting

Better plots

Pick a representation and stick with it

http://www-personal.umich.edu/ jpboyd/sciviz 1 graphbadly.pdf

(14)

Overview of Bad Plotting

Better plots

Unintuitive representation

(15)

Overview of Bad Plotting

Better plots

Color choices are key

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(16)

Overview of Bad Plotting

Better plots

Color choices are key

(17)

Overview of Bad Plotting

Better plots

Chart junk

http://en.wikipedia.org/wiki/File:Chartjunk-example.svg, Tufte, Edward R. (1983). The Visual Display of Quantitative Information. Cheshire, CT: Graphics Press.

(18)

Perceptually-based colormaps

Outline

1

Overview of Bad Plotting

2

Perceptually-based colormaps

3

Matplotlib Tools

(19)

Perceptually-based colormaps

Data Types

Categorical: Representing

discrete things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

http://stackoverflow.com/questions/7150453/order-categorical-data-in-a-stacked-bar-plot-with-ggplot2

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(20)

Perceptually-based colormaps

Data Types

Categorical:

Representing discrete

things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

http://stackoverflow.com/questions/7150453/order-categorical-data-in-a-stacked-bar-plot-with-ggplot2

(21)

Perceptually-based colormaps

Data Types

Categorical: Representing

discrete things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

http://www.gnuplotting.org/tag/colormap/ http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(22)

Perceptually-based colormaps

Data Types

Categorical: Representing

discrete things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

(23)

Perceptually-based colormaps

Data Types

Categorical: Representing

discrete things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(24)

Perceptually-based colormaps

Data Types

Categorical: Representing

discrete things, not on

continuum

Interval or sequential:

intervals of the data are

equal distances

Ratio or diverging: has

critical value (often 0)

and ratios of values are

equal

⇒ Equal steps in data should

correspond to equal steps in

perception

(25)

Perceptually-based colormaps

Color is 3D

r : saturation/color intensity, z: luminance/brightness, θ: color hue

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(26)

Perceptually-based colormaps

Color is 3D

r : saturation/color intensity, z: luminance/brightness

, θ: color hue

⇒ good for representing continuous variations in data magnitude

(27)

Perceptually-based colormaps

Jet Luminance

http://www.mathworks.com/matlabcentral/fx files/28982/16/spectrum vs cubicYF.png

(28)

Perceptually-based colormaps

Hue-based Colormaps Perceptually Distort Information

(29)

Perceptually-based colormaps

Luminance and Saturation Colormaps

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(30)

Perceptually-based colormaps

Improved Colormapping

(31)

Matplotlib Tools

Outline

1

Overview of Bad Plotting

2

Perceptually-based colormaps

3

Matplotlib Tools

4

Miscellaneous Considerations

(32)

Matplotlib Tools

(33)

Matplotlib Tools

Types of Colormaps

http://matplotlib.org/examples/color/colormaps reference.html

(34)

Matplotlib Tools

Types of Colormaps

(35)

Matplotlib Tools

Types of Colormaps

http://matplotlib.org/examples/color/colormaps reference.html

(36)

Matplotlib Tools

Types of Colormaps

(37)

Matplotlib Tools

Subplot

http://matplotlib.org/examples/subplots axes and figures/subplot demo.html

(38)

Matplotlib Tools

Axes Grid Toolbox

(39)

Matplotlib Tools

Inset Axes

(40)

Matplotlib Tools

(41)

Matplotlib Tools

Overlaid Axes: Colorbar Placement

(42)

Miscellaneous Considerations

Outline

1

Overview of Bad Plotting

2

Perceptually-based colormaps

3

Matplotlib Tools

(43)

Miscellaneous Considerations

Use Colormaps for Different Purposes

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

(44)

Miscellaneous Considerations

Cube Helix

Proper intensity scaling, though do consider application

(45)

Miscellaneous Considerations

Give Context

(46)

Miscellaneous Considerations

(47)

Miscellaneous Considerations

Discrete vs. Continuous Colorbar

http://figuredesign.blogspot.com/2012/04/meeting-recap-colors-in-figures.html

(48)

Miscellaneous Considerations

Diverging Colormap: Critical value treatment

(49)

Miscellaneous Considerations

Printing in Black and White from Color

Change the design choices altogether, or be sure the colors will print to

different grayscale values

http://figuredesign.blogspot.com/2012/04/meeting-recap-colors-in-figures.html

(50)

Miscellaneous Considerations

Color Blindness

Problems distinguishing green-yellow-red, and rarely blue-yellow

(51)

Miscellaneous Considerations

Resources

Edward Tufte’s books

IBM articles:

http://www.research.ibm.com/people/l/lloydt/color/color.HTM

Color Brewer: Color advice for maps: http://colorbrewer2.org

IEEE Computer Society article:

http://www.sv.vt.edu/ rkriz/Projects/create color table/color 07.pdf

MatLab colormap function, with lots of references:

http://www.mathworks.com/matlabcentral/fileexchange/28982-perceptually-improved-colormaps/content/pmkmp.m

Cube Helix colormap:

http://www.mrao.cam.ac.uk/ dag/CUBEHELIX/+

Test plots for sensitivity to color blindness:

http://www.etre.com/tools/colourblindsimulator/

Matplotlib example gallery:

http://matplotlib.org/gallery.html

Useful design blog: http://figuredesign.blogspot.com

Figures writeup:

http://www-personal.umich.edu/ jpboyd/sciviz 1 graphbadly.pdf

References

Related documents

If the inspiration of the itinerary is from listening to experiences family friends, the decision making still becomes biased since it is some other person’s experience, moreover

[11] trained traditional linear regression models using the classical iteratively re-weighted least square algorithm; Rahman and Devanbu [33] used four different machine

The evidence of a mutually reinforcing interplay of addiction, crime, mental illness, poor physical health and long-term and recurrent homelessness is longstanding (Kemp et

 Department of Marketing, Kelley School of Business, Indiana University, Bloomington, 10/2007. “Intermediate Effects

Correlations obtained between the series of the standardized precipitation index (SPI) at the time scales of 3, 6, 9 and 12 months and the standardized streamflow index series

Table 3 shows a characterizing profile for each living lab and illustrates that the new added building blocks act as a differentiator. However, it should be noted that these

The main substrate surface processes are schematically illustrated in Fig. Figure 11: Schematic illustration of the surface processes occurring during MBE growth. These