how to read and understand seaborn using joinplot(f1,f2) - python-3.x

The following code
a= np.random.randn(100)
b=np.random.randn(100)
sns.jointplot(a,b)
produces
What is the histogram on the top and right hand side?
And how do I read this graph?

The histogram on the top shows the distribution of the variable at the x-axis and the histogram to the right shows the distribution of the variable at the y-axis.
And the scatter plot is the usual x=a Vs y=b. Hope it helps.

Dataser a's x axis also becomes x axis of the joint plot, database b's x axis becomes y axis of the joint plot. Graph on top and rhs, are same as the individual histogram. The graph is continuous, and changes on bin change, unlike histogram where it may be discontinuous

Related

What the 'set logscale' does in gnuplot?

My question is more about math then the actual code.
When use the command
set logscale
on gnuplot 5.0 what is happening ?
It should represents the logarithmic values values of the x and y points.
But it doesn not seems to work properly. For example on my data I have x and y values smaller then 1 so I am expecting to see negative values for these values on the plot, but I see only postivie values.
What I am doing wrong ?
The logarithmic scale still shows the real values around the axes, just their distances are logarithmic. To really see the negative values, you need to really apply the log function:
plot "file.dat" using (log($1)):(log($2)) with lines
without setting the logscale.
A specific example might help to illustrate the effect of logarithmic scaling:
set xrange [0.1:10]
plot x**2
Let's plot this again, but this time on a logarithmic scale. Watch how the scaling of the x and y axes changes:
set logscale
replot

Can't align x-axis on hybrid scatter/area chart

Please have a look at This Excel chart. Here is a screenshot:
Here is the data:
There is a scatter series of blue of dots (plus a trendline) and a green area series. The chart data are contained within the series.
The problem I have is that the x-axis values of the two series are not aligned. For example, the second and third blue dots at x = 3.1 and x = 3.8 are in the correct place along the x-axis, but in the green area series they appear to be above x = 2.0 and x = 3.3. How to fix this?
Change the Scatter to a Line Chart, then format Line Color so that there is "No Line". Add trendline.
There may be another way to do this while retaining the Scatterplot, I'm not sure, but this seems to be visually what you're looking for, but I think you will need to use a Line Chart for this unfortunately. The problem is summarized in this similar Q on SuperUser:
https://superuser.com/questions/964264/aligning-stacked-bar-chart-w-scatter-plot-data
The short answer is that your combining (unsuccessfully) a categorical series (the columns) with interval/ratio series (the line charts). So, Excel doesn't know how to plot your categories (columns) on an interval scale (the current X axis).
You can verify this by selecting Chart > Layout > Axes > Secondary Horizontal Axis > More Secondary Horizontal Axis Options. Without making any changes to the axes configuration, the second X-axis will now appear along the bottom of the chart, and you can see it is scaled differently from your Scatter data.
I.e., in the Scatter series, the data is X/Y pairs. But in your Area chart, it treats the X-values as categorical, and in this context "1.1" is no different than "Bob" -- it is a cardinal representation of the data rather than an ordinal representation.
The problem I have is that the x-axis values of the two series are not aligned.
So even though the two series appear to share the same set of X-Values, the Chart is simply incapable of treating those as the same type of data. The x-axes are not aligned because they are not the same data or even the same type of data!
All that said, if you change both series to XY Scatter, it is possible (with some extraordinary effort) to apply shading/coloring below a series or between two series, etc.
http://peltiertech.com/fill-under-between-series-in-excel-chart/
http://chandoo.org/wp/2013/02/13/shaded-line-charts-excel/
What you can do is plot the Area graph on a secondary axis. Then go to Chart -> Layout -> Axes -> Display Secondary Horizontal Axis to see the axis, right click for its properties and change the type of the Axis Type to "Date axis". This (kind of) changes the axis to a numerical type, as opposed to a category type.
However, the area graph will still be placed incorrectly too far to the right because Excel will continue to plot the series as a (kind of) category type, with its data points appearing in the centre of each category as opposed to at the correct x value like in an XY scatter plot.
To get the graphs overlaying the most correctly, you can create a Scaled-up x value series which is, say, 1,000 times the original x-values and use this for the x-values of the area plot. By scaling by 1,000 or 10,000, you eventually get the granularity to a point where it looks more like X-Y plot, but is actually an area plot, and the graphs look like they coincide perfectly.

Flip X and Y axis on Excel custom chart

I've made a chart with Excel 2010's "Combo" option for chart type so I can plot two data series for the same depth points. The image below shows the default, which is very close to what I want - except I would like to have the axes flipped so that the current X axis, which is depth, is displayed as the Y axis and both primary and secondary current Y axes plot as X axes. In other words, I'd like to rotate the chart area by 90 degrees clockwise. The "Switch Row/Column" doesn't do what I want (or expect) and I'm running out of both ideas and patience. Is there an easy fix? Or a hard fix?
Here's the plot as-is:
And here's a dummy plot of the end goal made by rotating the image around in Paint, in case the picture makes it clearer:
Finally, as was pointed out in the comments, the whole thing looks goofy and might be better plotted as a bar graph with two bars. I tried this as well and came away almost all set - but the gray bars plot from left to right and the blue bars plot from right to left. Seems like it should be as simple as changing the "Plot Series On" option to Primary Axis for both, but this destroys the graph.
I looked around and I think this link has instructions for what you're looking for: https://superuser.com/questions/188064/excel-chart-with-two-x-axes-horizontal-possible

I want to make a scatter graph of the output of ftrace (from kernel)

I want to make a scatter graph of the output of ftrace (from kernel) on asm_do_IRQ..The problem is there are 8000+ entries and I get the results as a single line plot. Is there any way to do a normalisation of the values so that I can get a scatter plot? The values I want to print are as below:
Interrupt Time
uart-pl011 196.98111
Nomadi 196.983246
prcmu 196.983307
dma40 196.983429
dma40 196.984222
Nomadi 196.98642
dma40 196.988922
prcmu 196.988953
since the number of values are huge, excel takes time on the Y axis and plots the number of interrupts on the X axis. But i want the interrupts by name on the Y axis and time on the X axis.
looks like this is not possible. Scatter graphs can only be used to plot two variables, and since one of the axes i want to plot is a string, this is not possible - i can only get a trend, not the exact plots vs time

How to plot on 2 different scales on an axis in gnuplot

I want to plot some data on x axis range [0:1] and y axis range [0:100], but on the x axis I have most of my data in range [0:0.1] and less data in the rest of the range. I thus wanted to expand the [0:0.1] range. I cannot use a logarithmic scale for the x axis as I have some data which is 0 and I cannot plot it if I use a logarithmic scale. Is there a way for plotting this in Gnuplot?
Ideally I would want to apply a logarithmic scale to the x axis, but start my plot from 0. That would help me to cover all the data and highlight the [0:0.1] range as well. Can it be done?
As you noted, it is impossible to have a logarithmic scale with a 0. I would use two graphs side by side, with separate x axes. You can do this through set multiplot layout 1,2.
I agree with Svante. An other option would be to introduce a second x-axis in the same plot. Then one x-axis would scale from 0:0.1 and the other would scale from 0:1. Depending on your data however this approach could be very confusing but I think especially if your data is primarily located between 0:0.1 this could work.

Resources