Errorbars on grouped bar graphs on ggplot - ggplot2

So I have been attempting to add errorbars to my graph and struggling. Here is a picture of my current bargraph and dataframe. I wish to average the sem of the participants so that I can have a single errorbar for each bar on the graph. Currently, it plotted the errorbars for each individual participant in each of the different scan locations. (https://i.stack.imgur.com/Rabwm.png)(https://i.stack.imgur.com/cqrP6.png)
I have tried using geom_errorbar with position dodge, but I guess I will need to have a singular sem value for each grouping rather than a singular sem value from each partcipant.

Related

how to make x axis as year-month in time series plot with 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??

How to plot histogram where a country is a bin

I am attempting to plot a histogram where the y-axis should be the count and the x-axis (i.e. the bins) should be composed of all the countries, but I cannot seem to figure out the code.
I have tried following https://datasciencelab.wordpress.com/tag/pandas/ and How to create Histograms in Panda Python Using Specific Rows and Columns in Data Frame, but both of those are for bar graphs and not for histograms.
per_country = df.groupby(['COUNTRY'])[['TOTAL']].sum()
per_country = per_country.sort_values('TOTAL')
per_country.head()
medals_per_country['TOTAL'].plot(kind='hist') # if hist is changed to bar, then it works, but I need a histogram and not a bar graph
The result should be a histogram where the x-axis includes a label for each country and the y-axis is the total for each country. Right now the bins are just based on the 'TOTAL', whereas the y-axis is the number of countries with said 'TOTAL'.
Can someone please point me in the right direction? Thank you!

Grouped errorbar with array of strings as data points

I have different measurements from two+ sensors. I want to compare the performance of each sensor for each measurement with errorbars (mean and std). I have no problems creating and formatting a standard errorbar plot for one y (sensor) and yerr per data point (measurement). But i'm trying to create a plot like this:
I can neither find the option to do this in the matplotlib documentation nor when i google it or search this site. The closest i found was this thread:
matplotlib: grouping error bars for each x-axes tick
But this solution doesn't work for me since my datapoints aren't numbers but a pandas dataframe index of strings.
So i found the solution in the Matplotlib documentation after all. Here's the link for people who might have the same question:
A bar plot with errorbars and height labels on individual bars.

Optimal display for overlapping series in a line chart

In a context of a line chart displaying time data in regular intervals where multiple series might overlap what would be the optimal way to:
A) hint the user that the chart has overlapping series?
B) give the user the capability to visualize all those series? Like spanning the series somehow?
For overlapping series in a line chart, I would keep the traditional line chart but put a label at the end of the graph with a color legend. The legend and label will help the user get information quickly.
Another version of a line chart for overlapping series can be a line area chat.
If you are not stuck on only line charts, I would suggest a bar chart. Below are some examples that you can use.
Example 1:
Example 2:
Example 3:
There are couple ways to indicate that there are overlapping series on a chart. You can increase the marker radius of one of them. The number of legend elements tells you how many series there is, too. Finally, you can distribute series on a different yAxis, with different top and height properties. Also, in styled mode, when you hover on legend item, other series opacity changes.
API Reference:
http://api.highcharts.com/highcharts/plotOptions.line.marker.radius
Examples:
http://jsfiddle.net/whsgpdyw/ - changing marker radius
http://jsfiddle.net/fuq6j4sg/ - each series on a different yAxis

How to plot hexagon to represent scores on ArcMap?

I want to plot hexagon to represent each point's scores in different aspects and show it on the map. Each score will be saved in the data table. How to plot them? Or are there any symbol which can has same effect like hexagon?