I have some data with 25 categories and when i plotted the data using barchartGC
it looked like
Is there any way I can tilt the X-axis text so I can read the values of Categories?
I am not sure what you mean with 'tilt', but here is how you could make it more readable.
As barchartGC is just a wrapper for lattice barchart, you are supposed to be able to use any arguments for barchart.
For instance, you could rotate your x-legend by adding this argument to your barchartGC call :
scales=list(x=list(rot=45, labels=your_labels))
Related
I have used facet_wrap to build my plot as picture below:
After considering abit, I have used scale_y_log10 to transform my data (4 panels in the plot).
However, I realized that I only need to do the transformation for the first panel not the others since those values are very closed to 0.
My idea is to separate those values I would like to transform and combine them later on. I wondering that whether I can use scale_y_log10 for only one single panel created by facet_wrap so that I dont have to separate my dataset.
Thanks
I would like to know how to do this kind of graphs using ggplot :
https://image.noelshack.com/fichiers/2019/21/3/1558514850-plot-example2.png
This is an excel graph. I already know how to do each of the two histogram (left and right) but I don't know how to plot the two of them on the same graph, separated on the middle of the graph, with this duality.
Maybe using a specific package or geom I don't know yet ?
Thanks for help
You need to build your histogram with geom_col(), to have positive values for one groupe, négative values for the second groupe, and then use coord_split()
From the examples of bar graphs I have seen here, the numbers on top of individual bars are those that correspond to the values on the y-axis. I'd like to use another set of numbers or text on a bar graph generated using matplotlib. How can this been done? I' like to use the method shown in:
http://composition.al/blog/2015/11/29/a-better-way-to-add-labels-to-bar-charts-with-matplotlib/
but can't figure out how to refer to a list of labels which might be numbers or text.
After several gyrations, the solution was relatively simple. I passed a list of numbers to the function described in the link above replacing the "height" variable. Also, I prefer to have the bar labels always above the bar, so I just found the largest "y" value and increased the ax.set_ylim to 110% of that value. Not too elegant but meets my needs.
I just came into a problem while making several maps in R, the problem I came to is that I want to plot several maps and some geom_points in those maps, each map will have some points with different values and so the legend with the scales (size and color) will change between maps. All I want is to have exactly the same legend, representing the same values (for both color and size). I've tried with breaks etc but my data is continuous, so I didn't find any way to fix it.
EDIT:Simple example
Will try to explain with simple example by myself. Imagine I have these two arrays to be plotted into different coordinates for 2 different days:
c<-(1,2,3,2,1)
c<-(1,9,2,1,2)
What I want is to set the legend of the plot to be always representing the range 1-9 as values of the geom_points, no matter the specific values of the given day, in a way that no matter the values, the legend will be always the same and if I try to set some slides, the scale will not change
Any ideas?
I am using a map_set call to draw a map, and then using contour to plot some data on top of it.
I want to add a legend to this plot to make it useful, but it would have to be below the entire plot, and everything I've tried creates an overlapping legend over top of my image.
Can you do two plots -- one for your contour map, and another for the colorbar/legend,
using the system variable !P.MULTI to lay them out one above the other? You might also
need to specify YMARGIN keywords appropriately on each plot to keep them from overlapping.
You use pre-written colorbar routines (cbar from JHU or colorbar from Coyote, for example) and use the POSITION keyword to put them exactly where you want them. You can also pass POSITION to MAP_SET to position that where you want it.