Any graphics library for unix that can draw histograms? - python

A python program needs to draw histograms. It's ok to use 3rd party library (free). What is the best way to do that?

You can use matplotlib.

Gnuplot.py lets you use Gnuplot from python.

How much power do you need? How much external weight are you willing to take on? ROOT is accessible in python using PyROOT. Heavy and a lot to learn to get the most out of it, but very powerful.

Related

Is it possible to use python in Unity3D for console development?

I am developing a 3D Graphing Calculator software in Unity3D. I am struggling to find good numerical/symbolic math libraries written in C/C#. Also, I want to make the calculator programmable (like the TI-84 Calculators everyone uses in school).
I found Python to be a very good language for the backbone of this project. SymPy and NumPy are really good math libraries. And Python would be really good for users to program the calculator. (Here is already a calculator, the Numworks, that supports Python programs. The team ported Python to the hardware.)
If I am developing for the PC, I could just use Python with openGL, or use IronPython in Unity.
However, I'm developing for the Nintendo 3DS. It may sound like a strange hardware choice, but it makes good sense. The 3DS has a stereoscopic display perfect for showing 3D functions. It has a joy stick to operate the camera. It has a touch screen to handle input. Imagine showing a height map of a 3D function on the lower display. You can use it to trace the function. You can draw a region D on it, and have the 3DS integrate over the region. You can take directional derivatives with your stylus. The possibility is endless.
The problem, of course, is that Unity doesn't support Python, and IronPython only supports Windows/Mac/Linux/Android.
Do you have any suggestions for me?
For example, any possible way to use python in unity for the 3DS? Any good math library in C/C#? Can I implement a good enough Python interpreter in C# to handle user's program (doesn't have to be complaint)?
You could try the Math.Net library for C#, it should have the functionality you need, or you could try IronPython, here is an article that might help you get started.
http://shrigsoc.blogspot.com/2016/07/ironpython-and-unity.html

Is there a python library to generate STL file for 3D printing?

I am currently in a project where a lot of 3D printing designs need to be done. They are all parameterized, so I'd like to write a python code to generate those design files (in .STL format) for me. I was wondering that, is there a python package that can do this? Because currently I am all doing those by hand using SolidWorks.
Thanks!
Yes there is... It's called FreeCAD.
The assembly module is already in the devel version (as of 06/15/2014) and will be of production quality really soon for real assemblies!
http://freecadweb.org/
Yes, more than one.
In my humble experience, I tried many Open Source tools for parametric CAD modeling using Python (FreeCAD, Rhino-Grasshopper, Blender, Salome).
All of them are valid options and the best one is represented by your ability to either model or code.
I recently favour SALOME (www.salome-platform.org) because of the straight forward "dump study" option, the continue development and the good API documentation.
Particularly I did some 3d prints using the exportSTL command once I had a solid worthy of printing and it was ok.
Nevertheless, if you intend to work on surfaces rather than solids, I don't think you will find anything worthy Open Source (Rhino has a little price to pay).
There is also a new one ! called pymadcad
It's a library meant to do complete CAD stuff only with python scripts.
At contrary to FreeCAD, Pymadcad is natively dealing with triangular meshes so it makes it very easy to import/export .stl files.
There is a growing amount of surface generation functions (extrusion, revolution, tube, screw, smooth surface, ...). And there is also all the stuff to generate and deal with 3D primtives such as Lines, Arc, ...
Here is a brief look at the features

3RSSH smoothing in Python

I'm looking for running median smoothing implementations for Python. 3RSSH in particular.
There is an implementation for Excel that works fine:
http://www.quantdec.com/Excel/smoothing.htm
Also, R's smooth function has 3RSSH: http://exploratorydataanalysis.blogspot.com/2009/03/smoothing-on-r.html
But I want a Python version, preferably working with numpy/scipy and can't find one.
So far, I've had no luck with googling.
Are there any libraries implementing such smoothing functions? Or am I destined to write one? :)
Don't think I saw a 3RSSH implementation, but you could try using scipy.signal to try and make one.
Maybe these will be enough for your application?
scipy.signal.medfilt
scipy.signal.medfilt2d
scipy.ndimage.filters.median_filter

Renderer for 3D model (points/lines) in Python

I have a 3d model that consists of points, lines and balls in space. For debugging, it would be nice to render these objects in real time and rotateable.
What are my easiest options to achieve this in python?
Since I know nothing about graphical programming, I'd like to write as litte boilerplate code as possible.
The easiest way to get 3d graphics on screen in python is VPython, though if your model is stored in a CAD file format, you'll need some other library to load the data. With just VPython, you will either need to hard-code the model or implement your own loader.
Two options I'd consider myself (depends what you're trying to do in the end):
Blender has fairly amazing Python integration. Simple example here. As I understand it, Blender's own file save format is executable python which prods the Blender Python API to reconstruct the scene. There's also a mechanism for introducing gamey logic into the Blender world but I know even little about it. Blender does have a crazy steep learning curve though.
Get into OpenGL using the Python OpenGL bindings. "Simple" example.
If you're more interested in creating the models, go with the former; if you're more interested in the rendering of them, go with the latter.
The first thing that springs to mind is processing which is an easy to use visualization toolkit. Although you actually implement your visualizations in java, a quick google found this which lets you write your sketches in python instead.

Displaying & Modifying Diagrams / Flowgraphs in PyQt GUI

Essentially what I would like to do is draw a circuit diagram in a PyQt based on input given from another part of the GUI. My first thought was to simply use graphical tiles, and switch them out as pixmaps based on the input, but that is pretty clunky.
I suppose finding a way to actively display dia diagrams in a frame of the GUI would work as well.
Regardless, how would you recommend going about doing this? Is there as easier way?
Thanks!
Edit: Does anyone have experience with any of the following?
http://code.google.com/p/pydot/
http://code.google.com/p/python-graph/
http://code.google.com/p/yapgvb/
http://live.gnome.org/Dia/Python
To anyone that needs to go down this route in the future, the best option was definitely pydot. Easy to use, and pretty full-featured. Way to go, Graphviz.

Categories

Resources