![]() ![]() ![]() Using the Africa data ( fertility_africa and female_literacy_africa), add a red circle glyph of size=10 and alpha=0.8 to the figure p.To do this, you will need to specify the color, size and alpha keyword arguments inside p.circle(). ![]() Using the Latin America data ( fertility_latinamerica and female_literacy_latinamerica), add a blue circle glyph of size=10 and alpha=0.8 to the figure p.In this exercise, you'll plot female literacy vs fertility for Africa and Latin America as red and blue circle glyphs, respectively. It takes in floating point numbers between 0.0, meaning completely transparent, and 1.0, meaning completely opaque. The alpha parameter controls transparency. Size values are supplied in screen space units with 100 meaning the size of the entire figure. Bokeh accepts colors as hexadecimal strings, tuples of RGB values between 0 and 255, and any of the 147 CSS color names. The three most important arguments to customize scatter glyphs are color, size, and alpha. The code to create, display, and specify the name of the output file has been written for you, so after adding the x glyph, hit 'Submit Answer' to view the figure.Add an x glyph to the figure p using the function p.x() where the inputs are the x and y data from Africa: fertility_africa and female_literacy_africa.Add a circle glyph to the figure p using the function p.circle() where the inputs are the x and y data from Latin America: fertility_latinamerica and female_literacy_latinamerica.It has two parameters: x_axis_label and _axis_label. Create the figure p with the figure() function.Your job is to plot the Latin America data with the circle() glyph, and the Africa data with the x() glyph.įigure has already been imported for you from otting. Each set of x and y data has been loaded separately for you as fertility_africa, female_literacy_africa, fertility_latinamerica, and female_literacy_latinamerica. In this exercise, you will plot female literacy vs fertility for two different regions, Africa and Latin America. Create and display the output file using show() and passing in the figure p.īy calling multiple glyph functions on the same figure object, we can overlay multiple data sets in the same figure.Use the output_file() function to specify the name 'fert_lit.html' for the output file.Add a circle glyph to the figure p using the function p.circle() where the inputs are, in order, the x-axis data and y-axis data.It has two parameters: x_axis_label and y_axis_label. Import the figure function from otting, and the output_file and show functions from bokeh.io.Note: You may have to scroll down to view the lower portion of the figure. You can click on the question mark sign for more details on any of these tools. Your job is to create a figure, assign x-axis and y-axis labels, and plot female_literacy vs fertility using the circle glyph.Īfter you have created the figure, in this exercise and the ones to follow, play around with it! Explore the different options available to you on the tab to the right, such as "Pan", "Box Zoom", and "Wheel Zoom". The x-axis data has been loaded for you as fertility and the y-axis data has been loaded as female_literacy. This dataset highlights that countries with low female literacy have high birthrates. In this example, you're going to make a scatter plot of female literacy vs fertility using data from the European Environmental Agency. # AAPL Stock aapl_url = '' # Automobile miles per gallon auto_url = '' # Gapminder gap_url = '' # Blood glucose levels glucose_url = '' # Female literacy and birth rate female_url = '' # Olympic medals (100m sprint) sprint_url = '' # State coordinates state_url = ''
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |