Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'd like to draw a three-dimensional trajectory that can show the attitude of the plane as shown in the figure. What toolkit in Python I should learn?
What you are looking for is 3D Line plots of Matplotlib.
To help you get started, you can refer to this Blog: An easy introduction to 3D plotting with Matplotlib
The official Tutorial of matplotlib 3D Plots can be found here: Matplotlib 3D Tutorial - Lines
If you want to explore more, a very good resource to different types of Graph Plots along with code examples can be found here: Python Graph Gallery
the standard plotting library in python (pretty much) is Matplotlib. It contains a 3D API called mplot3d.
For an example, see here: https://matplotlib.org/stable/gallery/mplot3d/scatter3d.html
The example you are showing does look a lot like it was created with Matplotlib. Other options include seaborn and bokeh. Your choice what to use, really.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Similar to how there's vol3d for Matlab, how can I visualize a 3D-Array in Python? I'm currently working with Matplotlib but I'll take whatever works.
Mayavi has some good API for 3D plotting in python
I strongly recommend K3D:
K3D lets you create 3D plots backed by WebGL with high-level API
(surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects,
volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to
be easy for use as stand alone package like matplotlib, but also to
allow interoperation with existing libraries as VTK.
It works best in Jupyter Notebook.
You are probably looking for mplot3d plot_surface, which is part of matplotlib. Examples are provided in the link.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
As a graduate, I often plot various kind of figures and have found many plotting software.
I appreciate the high quality drawings in TeX, using tools like Asymptote and Tikz. As a poor programmer, I also need the flexibility brought by Python when I need do some complex calculations during plotting. The combination from both side, which I deeply believe, will be a perfect choice.
So, is there any chance for me to find some software like this, with both Simple and Beatiful in mind.
There are several python libraries which excel at various types of graphics such as MayaVi.
Here is an example of simple TeX integration with matplotlib in python (not showing all the math stuff, but just the plotting code:
figure(2)
plot(x,Ni[:,1], 'b.', x, y, 'r.', x, z, 'g.', markersize=10)
xlabel('nm')
ylabel('Sulfur normalized intensity')
legend(['Ni/S', r'exp profile $\tau$ = 200 nm', r'exp profile $\tau$ = 98 nm'], loc='best', numpoints=1)
pylab.subplots_adjust(bottom=0.15, left=0.15)
show()
which produces:
Notice the tau is actually just a snippet of TeX embedded into the image. Most of the matplotlib commands allow this so you can draw equations into your image or whatever you want to do.
What's best open source library in Python to draw chart/diagram? 2D is necessary, and 3D is good if provided together. and it has to accept simple input data format like csv.
I googled one called: matplotlib, how is it and any others?
It should be best in terms of the reliability, performance, simple use and easy integration, etc., or a combination of them.
Thanks
From the official python wiki:
Over the years many different plotting modules and packages have been
developed for Python. For most of that time there was no clear
favorite package, but recently matplotlib has become the most widely
used.
matplotlib highlights for me:
easy to learn (based on matlab traditions but also features object-oriented paradigm)
reliable (well-supported, updated, and documented)
robust (check out some of the stuff you can do with it!)
large community of users (well-liked and highly regarded in many circles)
easy to integrate (works natively alongside numpy/scipy)
accepts TeX commands for special formatting
quite the accepted standard for both simple and complicated chart drawing
I personally use it for many purposes including making diagrams for work presentations, graphics for school papers, and even charts and images for formal scientific documentation in mathematics and computer science. Especially the TeX stuff is particularly useful to me.
So I think you had the right idea. Matplotlib came up first in your google search because it's by far the most reputable, and in general the most useful.
In case you want to investigate some others, here's a link to an overview of some available plotting tools on the official python wiki: http://wiki.python.org/moin/NumericAndScientific/Plotting#Plotting_Tools
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
What are the available libraries for creating pretty charts and graphs in a Python application?
I'm the one supporting CairoPlot and I'm very proud it came up here.
Surely matplotlib is great, but I believe CairoPlot is better looking.
So, for presentations and websites, it's a very good choice.
Today I released version 1.1. If interested, check it out at CairoPlot v1.1
EDIT: After a long and cold winter, CairoPlot is being developed again. Check out the new version on GitHub.
For interactive work, Matplotlib is the mature standard. It provides an OO-style API as well as a Matlab-style interactive API.
Chaco is a more modern plotting library from the folks at Enthought. It uses Enthought's Kiva vector drawing library and currently works only with Wx and Qt with OpenGL on the way (Matplotlib has backends for Tk, Qt, Wx, Cocoa, and many image types such as PDF, EPS, PNG, etc.). The main advantages of Chaco are its speed relative to Matplotlib and its integration with Enthought's Traits API for interactive applications.
You can also use pygooglechart, which uses the Google Chart API. This isn't something you'd always want to use, but if you want a small number of good, simple, charts, and are always online, and especially if you're displaying in a browser anyway, it's a good choice.
You didn't mention what output format you need but reportlab is good at creating charts both in pdf and bitmap (e.g. png) format.
Here is a simple example of a barchart in png and pdf format:
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart
d = Drawing(300, 200)
chart = VerticalBarChart()
chart.width = 260
chart.height = 160
chart.x = 20
chart.y = 20
chart.data = [[1,2], [3,4]]
chart.categoryAxis.categoryNames = ['foo', 'bar']
chart.valueAxis.valueMin = 0
d.add(chart)
d.save(fnRoot='test', formats=['png', 'pdf'])
alt text http://i40.tinypic.com/2j677tl.jpg
Note: the image has been converted to jpg by the image host.
CairoPlot
I used pychart and thought it was very straightforward.
http://home.gna.org/pychart/
It's all native python and does not have a busload of dependencies. I'm sure matplotlib is lovely but I'd be downloading and installing for days and I just want one measley bar chart!
It doesn't seem to have been updated in a few years but hey it works!
Have you looked into ChartDirector for Python?
I can't speak about this one, but I've used ChartDirector for PHP and it's pretty good.
NodeBox is awesome for raw graphics creation.
If you like to use gnuplot for plotting, you should consider Gnuplot.py. It provides an object-oriented interface to gnuplot, and also allows you to pass commands directly to gnuplot. Unfortunately, it is no longer being actively developed.
Chaco from enthought is another option
You should also consider PyCha
http://www.lorenzogil.com/projects/pycha/
I am a fan on PyOFC2 : http://btbytes.github.com/pyofc2/
It just just a package that makes it easy to generate the JSON data needed for Open Flash Charts 2, which are very beautiful. Check out the examples on the link above.
Please look at the Open Flash Chart embedding for WHIFF
http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts
and the amCharts embedding for WHIFF too http://aaron.oirt.rutgers.edu/myapp/amcharts/doc. Thanks.
You could also consider google charts.
Not technically a python API, but you can use it from python, it's reasonably fast to code for, and the results tend to look nice. If you happen to be using your plots online, then this would be an even better solution.
PLplot is a cross-platform software package for creating scientific plots. They aren't very pretty (eye catching), but they look good enough. Have a look at some examples (both source code and pictures).
The PLplot core library can be used to create standard x-y plots, semi-log plots, log-log plots, contour plots, 3D surface plots, mesh plots, bar charts and pie charts. It runs on Windows (2000, XP and Vista), Linux, Mac OS X, and other Unices.