How to plot functions

How can i plot functions like for ex. f(x)=x*2? Is there a simple way for this? I’m currently trying to create a plot for my waveshaper.

You could have a look at the equalizer example. There is a PlotView for each frequency response.

Basically inherit from MagicPlotSource and put an instance into the magicState.
When you add a Plot to the GUI, you can select that plot source.
The view will call repeatedly for a path to draw.
It is best to cache that path object and only recalculate it when necessary.

This is where the EqualizerExample adds the plots:

Hope that helps