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
Support for subplots #55
Comments
I'm currently assessing the potential to use OxyPlot in some projects. Subplots is important to us. I guess the lack of comments on this issue indicates that there has been no progress on this? |
I think some architectural changes are required to support subplots. A model composed of multiple plotmodels should not be difficult to make, but I think this will also some refactoring of the views... |
you can make a multimodel plotViewer using column definitions. In MVVM I was able to create to PlotModel MyPlotModel1 and MyPlotModel1 there I created two grid columns to hold the plots. Below is code snippet for the xaml grid <Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="480*"/>
<ColumnDefinition Width="480*"/>
</Grid.ColumnDefinitions>
<oxy:PlotView Model="{Binding MyPlotModel1}" Grid.Column="1"/>
<oxy:PlotView Model="{Binding MyPlotModel2}" Grid.Column="2" />
</Grid> |
I'd be very interested to help with implementing better sub-plot support. I've needed something not-dissimilar recently. To that end, I added a public method to The main problems I ran into, which will surely be problems for any manner of SubPlots:
Summary of stuff I did:
The main differences between I don't expect anyone wants this code to end up in Develop, but it might be useful for somebody out there. Example code and a picture can be found in this gist. |
More musings... A possible start?A good start might be to incorporate the This would make it fairly trivial to write a 'multi-plot' layer on top, which can measure plots and fix the margins as appropriate if they need to line up. This layer itself could be an The work has already been done in my aforementioned PlotModel Bounds branch, so I don't beleive there is any technical difficulty in the core library. I'd be happy to 'own' this task, and to do sort out the implementation. The question remains whether I think these would be valuable changes, because they alone would go a long way to enabling collections of non-interactive plots, and pulling apart the layout and rendering code would be valuable for a few reasons beyond maintainability. Interactive Multi-PlotsI don't believe it makes any sense (nor would be feasible) to change the job of This sounds unpleasant, because it means UI platforms have to provide 2 UI components: one for This only allows a single-layer of nesting: you can't place sub-plots within sub-plots. Perhaps, though, this makes sense, and any hierarchical structure should be handled by the particular I don't imagine The ability to position and 'measure' |
Refactor the plot views to allow a model composed of multiple
PlotModel
s.The composed model could have a grid layout defined by column widths and row widths.
The children (subplots) should define
PlotModel
, column, row, colspan, rowspan.http://matplotlib.org/examples/pylab_examples/subplots_demo.html
http://matplotlib.org/users/gridspec.html
http://se.mathworks.com/help/matlab/ref/subplot.html
http://www.dartmouth.edu/~rc/classes/matlab_graphics/Matlab-subplots.html
The text was updated successfully, but these errors were encountered: