Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M mypltemplate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • Yori Fournier
  • mypltemplate
  • Wiki
  • create your first axes

create your first axes · Changes

Page history
yfournier created page: create your first axes authored Feb 16, 2017 by Yori Fournier's avatar Yori Fournier
Hide whitespace changes
Inline Side-by-side
create-your-first-axes.md
View page @ 052aea4f
......@@ -15,20 +15,47 @@ class axMyFirstAxes(MyAxes):
# This is the function that will format the rawdata so that they can be plotted
def formatRawdata(self, rawdata):
# Extract some part of the data
rawdata1 = rawdata.data[<some key>]
rawdata2 = rawdata.data[<some key>]
# Extract some part of the data and format them
# Format the data
if(self.fig.keywords[<some key>]):
# format in a certain way
else:
# format in another way
xdata = <some formular>
ydata = <some formular>
# Put everything you need into the data of the axes
self.data = {'xdata': xdata,
'ydata': ydata}
'ydata': ydata,
'xlabel': xlabel,
'ylabel': ylabel}
# Returning True or False is not optional
return(True)
# This function is the plotting procedure
def plotting(self):
# You can get the keywords you need from the figure
xrange = self.fig.keywords.get('xrange', None)
yrange = self.fig.keywords.get('yrange', None)
# All matplotlib functions are available (see http://matplotlib.org/api/axes_api.html)
self.plot(self.data['xdata'], self.data['ydata'])
# Any decoration you need
self.set_xlabel(self.data['xlabel'])
self.set_ylabel(self.data['ylabel'])
if xrange is not None:
self.set_xlim(xrange)
if yrange is not None:
self.set_ylim(yrange)
# Returning True or False is not optional
return(True)
```
\ No newline at end of file
Clone repository
  • create your first axes
  • create your first figure
  • get started
  • Home