how to concatenate two histograms in python - python-3.x

The highlighted part is the one I am having problem with. I have imported numpy in python to make two histograms of image pixels. But cannot clearly figure out how to concatenate both the histograms together into one histogram?

I am not exactly sure what you mean by concatenate. I'm assuming you want multiple histograms side-by-side. If this is the case, your questions has already been answered here: Plot two histograms at the same time with matplotlib

Related

Histogram in gnuplot - bins not separated one from another

Sorry for my English,
I would like to make a histogram in gnuplot, where bins are not separated one from another by vertical lines, something like it is shown in the following figure:
I usually use "plot [...] with boxes" command to make a histogram, but it leads to a histogram with such vertical lines, which make the histogram unclear for bigger number of bins in the plot.
My data consists of two values for every value of x.
My comment again as answer, according to the StackOverflow "rule": no answers in comments...
You are probably looking for:
plot ... with steps
Check help steps. You may also want to check this answer about steps.

Seaborn: Plot scatterplot over lineplot in same plot

I am trying to create one plot with one scatter and multiple lineplots.
For the points to be seen well, I need the scatterplot in the front.
However changing the order inside my code doesn't solve this. The
lineplots always cover the scatterplot. Any ideas?
Please help.
Use the zorder parameter when scatterplotting, e.g.
sns.scatterplot(x, y, ax=ax, color='orange', zorder=7)
You may need to adjust the zorder value depending on the number of elements in your plot.

2D plot in python

I have 3 sets of data x,y,z where z represents the scan steps and z=50. Corresponding to z I have a each values of x and y. I want to plot a line or contour plot at 5th, 10th and 20th scan steps. Is it possible and which function should I use?
I don't fully understand how your data is organized, but Matplotlib is the easiest way to pop up a contour plot: see this for example:
http://matplotlib.org/examples/pylab_examples/contour_label_demo.html
If you remove the last past of that URL, you can browse the entire gallery for more examples, some of which may be closer to what you are try to do.
A more involved and more powerful alternative would be Chaco. You can refer to this example:
http://docs.enthought.com/chaco/user_manual/annotated_examples.html#contour-plot-py
Mayavi is for 3D plotting which doesn't seem to be what you are trying to do. If you are curious, checkout:
http://docs.enthought.com/mayavi/mayavi/
Hope this helps.

How to plot (isosurface!) a datafile with four columns (x,y,z,f(x,y,z))? Is is possible using gnuplot?

What are the possible ways to plot (isosurface!) a datafile with four columns (x,y,z,f(x,y,z))? Is it possible using gnuplot?
No, this is not possible with gnuplot, but you might want to use octave, which uses gnuplot as backend (still). There, see the isosurface function.

display values within stacked boxes of rowstacked histograms in gnuplot?

I am using gnuplot (Version 4.4 patchlevel 2) to generate rowstacked histograms, very similar to the example called "Stacked histograms by percent" from the gnuplot demo site at http://www.gnuplot.info/demo/histograms.html
I want to display the values of each stacked box within it.
I.e. I want to display the actual numerical value (in percent and/or the absolute number) of each box.
How can I do that?
How many numbers do you want to enter.
If it is just a few then have you tried
set label "label" at 2,3
If there are many then you can write a script to decide where to put the numbers - something like here
Plotting arrows with gnuplot
Don't know a way to do it by magic, although I am not very familiar with rowstacked histograms
Tom

Resources