Currently the x axis shows a lot of values overlapping on each other, and those values are actually from the "FiscalYear_Days" column, not the "Month-Day" column, so it looks like this line where I set the "ticktext" is ignored: ticktext = chart_data$`Month-Day`, ![]() I have exported my data frame with dput(), and here is the simplified example of what I try to do. ![]() I cannot figure out how to change the x axis labels to show different values than the x axis values based on what the chart shows. On the x axis I only want to show the month and the day, not the year, because the month and day would be matching for both lines, but the year would be different. The 2 lines represent cumulated counts of transactions per day during 2 consecutive years, so it would show how the current year performed compared to last year. O’Reilly Media.I am trying to show 2 lines on a chart using the plotly library, and plot_ly() function in R. Help on all the ggplot functions can be found at the The master ggplot help site.Ī useful cheat sheet on commonly used functions can be downloaded here.Ĭhang, W (2012) R Graphics cookbook. To further customise the aesthetics of the graph, including colour and formatting, see our other ggplot help pages: Print(IrisPlot myblanktheme labs(title = "Petal and sepal \nlength of iris", y = "Petal length (cm)", x = "Sepal length (cm)")) Legend.text = element_text(face = "italic", colour = "steelblue4", family = "Helvetica"),Īxis.title = element_text(family = "Helvetica", size = (10), colour = "steelblue4"), Plot.title = element_text(family = "Helvetica", face = "bold", size = (15)), The following code would remove the legend title and axis text. To do this you use the code = element_blank(), remembering those open and closed brackets. For example, size = (3).Īnother option is to remove the text from the plot entirely. Remember to include “” before and after the colour name. the colour can be changed to any of the colours listed here. the type of emphasis, with options including bold, italic and “alic”. Examples of fonts include: “Palatino”, “Helvetica”, “Courier”, “Times”. The font, colour, size and emphasis of any of these labels can be altered by arguments within element_text(your format). ![]()
0 Comments
Leave a Reply. |