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

Generalized matplotlib support #259

adtzlr opened this Issue Oct 12, 2017 · 5 comments


None yet
2 participants

adtzlr commented Oct 12, 2017


is there any option to use other matplotlib plots than xy-plots? (Like polar, 3d plots, subplots, etc.)
For example we could think of a very generalized figure, where the user can add axes with different plot options. But therefore it is necessary to have the figure return available:

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot([1, 2, 3, 4])

or other screnarios like 3d, polar, etc.:

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

Congrats, appJar is really easy to use and powerful!


This comment has been minimized.


jarvisteach commented Oct 12, 2017

All sounds very feasible. I know nothing about matplotlib, other than that it's tough to get working with tkinter.

I've resolved those issues, so anything is now possible - I just need a list of features!

Currently, adding a plot does the following:

  • Create a Figure()
  • add a sub_plot (called axes)
  • plot the specified data on the sub_plot
  • stick everything in a canvas widget
  • store the canvas
  • return the sub_plot

So, a few things spring to mind - you can access the Figure object and manipulate that:

app.addPlot("plot", ...)
fig = app.getPlotWidget("plot").fig

Or I could provide a function for adding plots that creates an empty figure in a canvas, and returns that figure, leaving you to manage adding subplots...


This comment has been minimized.

adtzlr commented Oct 12, 2017

Wow, your last line of code is perfectly fine!
So, with the following Code it is possible to use the full matplotlib functionality (3D as an example):

from appJar import gui 
app = gui()

axes = app.addPlot("p1", [1,2,3],[1,1,1])
fig = app.getPlotWidget("p1").fig

from mpl_toolkits.mplot3d import Axes3D
ax = fig.add_subplot(111, projection='3d')


Thank you very much!


This comment has been minimized.

adtzlr commented Oct 12, 2017

Probably a second method beside ax = app.addPlot("p1",..) would make sense like fig = app.addPlotFigure("p1") but that's just an idea. Thumbs up for your great work.

jarvisteach added a commit that referenced this issue Oct 12, 2017

Updates to Grid & Plot
Started moving grid code to cell #232

Added function to `.addPlotFig()` to allow easier customisation of
plots. Required making generic plot widget creator function #259

This comment has been minimized.

adtzlr commented Oct 14, 2017

Is it possible to resize the Figure in appjar? If I do
'fig.set_size_inches(10,20,forward=True)' the Figuren size changes but the matplotlib widget size in appjar stays the same.

@jarvisteach jarvisteach referenced this issue Oct 14, 2017


MatPlotLib Updates #267

3 of 6 tasks complete

This comment has been minimized.


jarvisteach commented Oct 14, 2017

Closing, see #267

@jarvisteach jarvisteach added this to the 0.90 milestone Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment