Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib basics #2

Open
PinkShnack opened this issue Oct 20, 2021 · 5 comments
Open

Matplotlib basics #2

PinkShnack opened this issue Oct 20, 2021 · 5 comments

Comments

@PinkShnack
Copy link
Contributor

Matplotlib:

  • Basic plots with plt
  • Basic Axes plots
  • subplots
  • broken/joined/shared axes
@PinkShnack
Copy link
Contributor Author

The second part of this notebook from the Python-Workshops module might be useful here.

@PinkShnack
Copy link
Contributor Author

I guess for the first workshop we should focus on lay-out of a plot, right? Then, in the next workshop we can build on that by introducing the previous SciViz basics (colour etc.) and how to do these basics with Matplotlib.

@lucaswittwer
Copy link
Contributor

Yes, let's start with the basis, e.g.,

  • plotting directly with plt.plot
  • labeling axes, adding title, adding legends
  • How to store your figures in different formats, resolution etc.
  • introducing how to work with fig = plt.figure(...), ax = fig.add_subplot(...)
  • why you want to do this and what you can do with it (more fine-grained control over the axis, etc.)
  • Changing figure ratio, adding sub-plots, etc.

In the end, we should try to cover more or less “the anatomy” of a plot (https://matplotlib.org/stable/gallery/showcase/anatomy.html)

@PinkShnack PinkShnack changed the title List of topics to cover Matplotlib basics Nov 10, 2021
@PinkShnack
Copy link
Contributor Author

PinkShnack commented Nov 10, 2021

Exercises:

  • B&W figure but we want to put it in a presentation with black background, so change figure to W&B.
  • Use special characters in the legend and axis labels
  • 3x3 figure, how to do it in a loop?

@PinkShnack
Copy link
Contributor Author

PinkShnack commented Nov 10, 2021

Other possible topics here

  • Unicode/Latex
  • Annotation - uses different coordinate systems
  • Figure sizes are in inches
    • Figure ratio in cm instead of inches (x 2.5)
  • Vector images and raster images
    • saving images as tiff
  • Do people have other ways of plotting that we don't know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants