Coder Social home page Coder Social logo

haraldev / tudelft_thesis_plotting Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.68 MB

Generates plots adhering to the TU Delft template (Utopia font) with Python Matplotlib.

Python 100.00%
plotting matplotlib tudelft dlr template latex colours palette

tudelft_thesis_plotting's Introduction

TU Delft thesis - MMX thesis plotting - minimum working example

This repository offers a minimum working example for a Python plotting tool which may be used with the TU Delft thesis template - my thesis is found here. This code enables plots with the Utopia font used in the TU Delft thesis template or any other font that is selected in the beginning of the plotting file.


Figure 1: Motor test example (compressed PNG file)

Example plot

Figure 1 shows an example from my thesis. The code is found the bottom minimum_working.py and the raw data is in data_file_example.csv. The plot contains two axes subplots, with the top one divided into two, resulting in three subplots. The x-axes is shared and the y-axes are different for every subplot. Each subplot has its own legend.

Sizing of plots and fonts

See this article for explanation of the set_size function and about font sizing. It comes down to defining the number you would use in Latex in \includegraphics[width=0.5\textwidth]{my-uploaded-figure.png}(at Overleaf), the 0.5 in this case, as the width of the figure. Matplotlib then ensures that the text size in the figure is the same as the text size.

I altered set_size function slightly to ensure I could change the height of the plots (sometimes I needed thinner, longer plots).

Installs

Tips

  • Structure: I used a .py file to write the code for all my plots and a .ipynb notebook to execute the plotting functions and organise myself. This resulted in a very structured and easy to understand notebook with all my plots (Figure 2).
  • Plot in pdf format, from the beginning, always.
  • Use wise filenames, I suggest including the get_timestamp so that you know when you plotted it.


Figure 2: Example of structured notebook

tudelft_thesis_plotting's People

Contributors

haraldev avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.