how to make x axis as year-month in time series plot with matplotlib? - matplotlib

I wanna make time series plot so I tried.
ut it seems like it detected 2011.01 as a number when I check the outcome plot.
How can I code to make it detect as a year-month not number??

Related

Matplotlib: Add contour plot to base of surface plot python

So I've produced a 3-d graph on python using trisruf:
ax.plot_trisurf(x,y,z)
and I end up with the following:
3d plot
So now I want to plot contours on the base of this same plot, When I tried using ax.contour(x,y,z) I get an error saying my z should be in 2-dimensions, however my data comes from three 1-d arrays.
How can I go about plotting contours on the base of my graph?
Ok so I managed to find the answer after a bit of searching,
ax.tricontourf(angle_x,angle_y,nlist,zdir='-z', offset = -0.859, cmap='coolwarm') worked, its important to make the offset just slightly lower than the lowest z point (or whatever direction you want the projection) so you can actually see the contour plot!
Here's the result:
updated plot with contour

How to display 2D bar graph with number of counts on Y-axis and month/day on x-axis in LabVIEW?

I want to plot 2D bar graph in LabVIEW showing total number of counts on Y-axis and Month/day(abbreviated) on x-axis. How can I do it?
Drop an XY graph.
Go to the plot properties and set Bar Plots to have the style you want and Interpolation to be just points.
If you open the context help window and hover over the terminal for the graph, you can see the data types it supports. You want the cluster which has a 1D array for the X values (timestamps of a time in the specific day) and a 1D array for the Y values. Generate your data in that format and wire it into the graph.
Right click the X scale and select Formatting.... In the properties dialog, set the format to be absolute time and to only show the day and the month.
Run the VI and you should have your graph.

Plotting non-overlapping curves with seaborn.pointplot

I'm trying to use Seaborn to plot two curves that shouldn't overlap perfectly. The blue curve in this example should be defined from 2 to 8, and the red line should be defined from 1 to 7, so they should appear slightly staggered. However, sns.pointplot draws both curves as if they overlapped perfectly. Here is the most minimal code I used to generate my plot:
g = sns.FacetGrid(myDF, col = 'condition', hue = 'manipulation',
col_order = ['condition1', 'condition2', 'condition3'])
g.map(sns.pointplot, 'ordinalIV', 'continuousDV', **{'x_estimator': np.mean})
Is there any way to shift these curves, so that they don't overlap? This issue seems similar to my problem, but I want to keep the bootstrapped confidence intervals in my plot, so I'm not sure how to re-create that. If anyone knows of a workaround to (1) compute bootstrapped confidence intervals outside of seaborn and (2) add them to a matplotlib plot, that would work too!

3d scatter plot with mplot3d with missing frequency as z axis

I am trying to plot some data but I only have my x and y axis given. I would like to get the frequency for my z axis like I would in a histogram. But I don't really want a histogram, rather a scatter plot or a surface plot.
This is my histogram right now, quite messy.
Is it possible to use the function of the histogram to get the frequency of the points but have a scatter/surface plot instead? Or to change the bars of the histogram to something like dots or something similar?
None of my data points have the same value, so I would like them to be sorted in intervals, like [0,0.05] or so, that's why I am trying to find another solution than calculating this.

converting diurnal scatter plot into heatmap plot

I have created a diurnal plot of date vs. time but it is rather messy and I'd prefer to create a heatmap. Something similar has been done here, but it doesn't work as I can't parse the time in as well. I tried this which works for the x-axis but I can't do the y.
Ideally, it would have a legend on the size showing how much data is in each 2D bin. How do I parse the x and y axis in such that numpy.histogram2D/imshow can read it or meshgrid/pcolormesh can be used?