-
Notifications
You must be signed in to change notification settings - Fork 15
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
[WIP] subplots API #43
Comments
I wanted to wait until you filled in the details, but no matter. First of all you're aware of the subplots macro from #34 here: What you describe is in possible already. Yes, not via creating a grid and filling it one after another. Only via a macro for now (but for the general use case it's really simple to use!). What you describe however is basically done by the combine proc here: For your type
Grid = object
plts: seq[PlotJson]
cols: int
rows: int
domains: seq[Domain]
proc `[]=`[T: Plot](grid: var Grid, idx: int, plt: T) =
grid.plts[idx] = plt.toPlotJson (didn't test that code) of course to avoid having the user deal with
That seems orthogonal to subplots to me? Although that's surely a nice feature. |
thanks; wasn't aware of let subplt = subplots:
baseLayout: layout
plot:
plt1
left: 0.0
bottom: 0.0
width: 0.45
height: 1.0
# alternatively use right, top instead of width, height
# single letters also supported, e.g. l == left
plot:
plt2
# or just write a concise tuple, here the
(0.55, 0.0, 0.45, 1.0) however that's not flexible enough for many workflows where's it's easier to fill them in 1 by 1 programmatically instead of declaratively (eg if arbitrary nrows/ncols or even if these are known at RT rather than CT)
i don't think it's such a big deal to expose that being said, there may be a way to do everything via |
[will write more details here]
the obvious next step is provide a nice API to generate subplots, as in matlab / matplotlib etc
Ideally:
let plots = createGrid(numPlots = 10, numPlotsPerRow = 3); plots[0] = ...
note
The text was updated successfully, but these errors were encountered: