Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal representations of the Matplotlib data. These are not API-stable and may change. You can easily extend the provided bindings without relying on the internals exposed here but they are provided just in case.
- mapLinear :: (Double -> b) -> Double -> Double -> Double -> [b]
- data Matplotlib = Matplotlib {
- mpCommands :: Seq MplotCommand
- mpPendingOption :: Maybe ([Option] -> MplotCommand)
- mpRest :: Seq MplotCommand
- data MplotCommand
- = LoadData ByteString
- | Exec { }
- data Option
- toPy :: MplotCommand -> String
- resolvePending :: Matplotlib -> Matplotlib
- withMplot :: Matplotlib -> ([String] -> IO a) -> IO a
- mplotString :: String -> Matplotlib
- mp :: Matplotlib
- readData :: ToJSON a => a -> Matplotlib
- (%) :: Matplotlib -> Matplotlib -> Matplotlib
- (#) :: MplotValue val => Matplotlib -> val -> Matplotlib
- class MplotValue val where
- optFn :: ([Option] -> String) -> Matplotlib -> Matplotlib
- options :: Matplotlib -> Matplotlib
- (##) :: MplotValue val => Matplotlib -> val -> Matplotlib
- renderOptions :: [Option] -> [Char]
- optionFn :: ([Option] -> [Option]) -> Matplotlib -> Matplotlib
- option :: Matplotlib -> [Option] -> Matplotlib
- (@@) :: Matplotlib -> [Option] -> Matplotlib
- def :: Matplotlib -> [Option] -> Matplotlib
- defFn :: [Option] -> [Option] -> [Option]
- python :: Foldable t => t String -> IO (Either String String)
- pyIncludes :: [[Char]]
- pyReadData :: [Char] -> [[Char]]
- pyDetach :: [[Char]]
- pyOnscreen :: [[Char]]
- pyFigure :: [Char] -> [[Char]]
- o1 :: String -> Option
- o2 :: String -> String -> Option
Documentation
mapLinear :: (Double -> b) -> Double -> Double -> Double -> [b] Source #
A handy miscellaneous function to linearly map over a range of numbers in a given number of steps
Basics
data Matplotlib Source #
The wrapper type for a matplotlib computation.
Matplotlib | |
|
data MplotCommand Source #
A maplotlib command, right now we have a very shallow embedding essentially dealing in strings containing python code as well as the ability to load data. The loaded data should be a json object.
Throughout the API we need to accept options in order to expose matplotlib's many configuration options.
toPy :: MplotCommand -> String Source #
Convert an MplotCommand
to python code, doesn't do much right now
resolvePending :: Matplotlib -> Matplotlib Source #
Resolve the pending command with no options provided.
withMplot :: Matplotlib -> ([String] -> IO a) -> IO a Source #
The io action is given a list of python commands to execute (note that these are commands in the sense of lines of python code; each inidivudal line may not be parseable on its own
mplotString :: String -> Matplotlib Source #
Create a plot that executes the string as python code
mp :: Matplotlib Source #
Create an empty plot. This the beginning of most plotting commands.
readData :: ToJSON a => a -> Matplotlib Source #
Load the given data into the 'data' array
(%) :: Matplotlib -> Matplotlib -> Matplotlib infixl 5 Source #
Combine two matplotlib commands
(#) :: MplotValue val => Matplotlib -> val -> Matplotlib infixl 6 Source #
Add Python code to the last matplotlib command
class MplotValue val where Source #
Values which can be combined together to form a matplotlib command. These specify how values are rendered in Python code.
MplotValue Double Source # | |
MplotValue Int Source # | |
MplotValue Integer Source # | |
MplotValue String Source # | |
MplotValue (x, y) => MplotValue [(x, y)] Source # | |
MplotValue [String] Source # | |
MplotValue x => MplotValue (x, x) Source # | |
Options
optFn :: ([Option] -> String) -> Matplotlib -> Matplotlib Source #
Add an option to the last matplotlib command. Commands can have only one option! optFn :: Matplotlib -> Matplotlib
options :: Matplotlib -> Matplotlib Source #
Merge two commands with options between
(##) :: MplotValue val => Matplotlib -> val -> Matplotlib infixl 6 Source #
A combinator like #
that also inserts an option
renderOptions :: [Option] -> [Char] Source #
An internal helper to convert a list of options to the python code that applies those options in a call.
optionFn :: ([Option] -> [Option]) -> Matplotlib -> Matplotlib Source #
An internal helper that modifies the options of a plot.
option :: Matplotlib -> [Option] -> Matplotlib Source #
Apply a list of options to a plot resolving any pending options.
(@@) :: Matplotlib -> [Option] -> Matplotlib infixl 6 Source #
A combinator for option
that applies a list of options to a plot
def :: Matplotlib -> [Option] -> Matplotlib Source #
Bind a list of default options to a plot. Positional options are kept in order and default that way as well. Keyword arguments are
Python operations
python :: Foldable t => t String -> IO (Either String String) Source #
Run python given a code string.
pyIncludes :: [[Char]] Source #
The standard python includes of every plot
pyReadData :: [Char] -> [[Char]] Source #
The python command that reads external data into the python data array
pyOnscreen :: [[Char]] Source #
Python code to show a plot