omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. nvedwards

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    nvedwards

    @nvedwards

    0
    Reputation
    470
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    nvedwards Unfollow Follow

    Latest posts made by nvedwards

    • RE: How to populate designer tableview sections with a dictionary

      Very helpful. Thanks much!

      posted in Pythonista
      nvedwards
      nvedwards
    • How to populate designer tableview sections with a dictionary

      I’m trying to populate a tableview with the contents of a dictionary. i want the tableview data to be grouped by sections following the rows belonging to each section. Below is the code that i put together so far. The keys show up in the tableview but not the values. How do you populate the rows/cells of each section with the key values?

      Thanks!

      import ui
      
      
      def load_table(view):
      	#data = ['spam', 'ham', 'egg']
      	# Sections and section rows
      	data = {'meat': ['spam', 'ham'], 'fruit': ['apple', 'orange']}
      	
      	datasource = ui.ListDataSource(data)
      	view['tv_food'].data_source=datasource
      	view['tv_food'].delegate=datasource
      
      
      def main():
      	view = ui.load_view('tableview_test') # tableview from designer
      	load_table(view)
      	nav = ui.NavigationView(view)
      	nav.present()
      
      
      if __name__ == '__main__':
      	main()
      
      posted in Pythonista
      nvedwards
      nvedwards
    • RE: Tex Rendering via matplotlib/Tex

      Thanks much JonB!

      posted in Pythonista
      nvedwards
      nvedwards
    • Tex Rendering via matplotlib/Tex

      Hello there!

      I am trying to create images of various mathematical equations so that I can include them in a document that I am working on. Using the code below, I have been successful rendering every type of equation that I have tried except a matrix equations.

      The LaTex markup that I used to generate the matrix is:

      r'$begin{Bmatrix} 1 & 2 \\ 3 & 4 \end{Bmatrix}$'

      Does Pythonista support rendering matrix equations? If so, how is it done?

      Thanks for the help!!

      Code:

      
      #import matplotlib.pyplot as plt
      from matplotlib import rc
      
      df_fig_sz = [1, 1]
      formulas = [[r'$\alpha > \beta$', df_fig_sz, 0.2, 0.25, 'alpha beta'], 
      [r'$\alpha_i > \beta_i$', df_fig_sz, 0.2, .25, 'ss_script'], 
      [r'$\sqrt{2}$', df_fig_sz, 0.2, .25, 'radicals_01'], 
      [r'$\sqrt[3]{x}$', df_fig_sz, 0.2, .25, 'radicals_02']
       ]
      for f in formulas:
      	params = {'figure.figsize': f[1],}
      	plt.rcParams.update(params)
      	fig = plt.figure()
      	fig.text(f[2], f[3], f[0])
      	plt.savefig(f[4] + '.png')
      
      posted in Pythonista
      nvedwards
      nvedwards
    • RE: Tex Rendering via matplotlib/Tex

      Thanks omz. This is my first time posting so I appreciate the help. btw, I love both Pythonista and Editoria. Great Apps!!!

      posted in Pythonista
      nvedwards
      nvedwards
    • RE: Tex Rendering via matplotlib/Tex

      ccc,
      I assume that you mean that I should format my code according to the example you provided. I did and now my code appears to have no structure. Please clarify. Thanks.

      posted in Pythonista
      nvedwards
      nvedwards