matplotlib

plot dataframe with two y-axes

ⅰ亾dé卋堺 提交于 2021-02-20 06:16:57
问题 I have the following dataframe: land_cover 1 2 3 4 5 6 size 0 20 19.558872 6.856950 3.882243 1.743048 1.361306 1.026382 16.520265 1 30 9.499454 3.513521 1.849498 0.836386 0.659660 0.442690 8.652517 2 40 10.173790 3.123167 1.677257 0.860317 0.762718 0.560290 11.925280 3 50 10.098777 1.564575 1.280729 0.894287 0.884028 0.887448 12.647710 4 60 6.166109 1.588687 0.667839 0.230659 0.143044 0.070628 2.160922 5 110 17.846565 3.884678 2.202129 1.040551 0.843709 0.673298 30.406541 I want to plot the

plot dataframe with two y-axes

懵懂的女人 提交于 2021-02-20 06:16:18
问题 I have the following dataframe: land_cover 1 2 3 4 5 6 size 0 20 19.558872 6.856950 3.882243 1.743048 1.361306 1.026382 16.520265 1 30 9.499454 3.513521 1.849498 0.836386 0.659660 0.442690 8.652517 2 40 10.173790 3.123167 1.677257 0.860317 0.762718 0.560290 11.925280 3 50 10.098777 1.564575 1.280729 0.894287 0.884028 0.887448 12.647710 4 60 6.166109 1.588687 0.667839 0.230659 0.143044 0.070628 2.160922 5 110 17.846565 3.884678 2.202129 1.040551 0.843709 0.673298 30.406541 I want to plot the

plot dataset and labels over multiple rows (jupyter notebook)

与世无争的帅哥 提交于 2021-02-20 05:02:14
问题 I have the following code below which simply plots datasets (consisting of dogs and cats images) and their labels. I'm using jupyter notebook: train_path = 'dataset/train' valid_path = 'dataset/valid' test_path = 'dataset/test' train_batches = ImageDataGenerator().flow_from_directory(train_path, target_size=(224,224), classes=['dog', 'cat'], batch_size=10) valid_batches = ImageDataGenerator().flow_from_directory(valid_path, target_size=(224,224), classes=['dog', 'cat'], batch_size=4) test

Assign color to value [closed]

会有一股神秘感。 提交于 2021-02-20 04:14:25
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . Improve this question I'd like to assign to values colors, using matplotlib or colormap. More concretely: If I've got a small value (let's say that -14 is the smallest value) and a high value (let's say 86 is the highest value), I'd like to print the objects with low values more red, and objects

Assign color to value [closed]

谁都会走 提交于 2021-02-20 04:10:41
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . Improve this question I'd like to assign to values colors, using matplotlib or colormap. More concretely: If I've got a small value (let's say that -14 is the smallest value) and a high value (let's say 86 is the highest value), I'd like to print the objects with low values more red, and objects

How to autoscaled graphs with picking legend (matplotlib)?

試著忘記壹切 提交于 2021-02-20 04:09:41
问题 I am working on a picking legend with matplotlib. The goal is to hide and shows curves, by clicking on the legend. I found this solution (Hiding lines after showing a pyplot figure), which works very well. I want improve this code to adapt automatically the axis after each clic on the legend. I don't know if it is possible. Do you have any hint? Their is an example of what I want on the images below. First of all, the Image 1 represents the graph. Then after clicking on the legend 5*sin(x),

Assign color to value [closed]

纵饮孤独 提交于 2021-02-20 04:09:27
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . Improve this question I'd like to assign to values colors, using matplotlib or colormap. More concretely: If I've got a small value (let's say that -14 is the smallest value) and a high value (let's say 86 is the highest value), I'd like to print the objects with low values more red, and objects

How to autoscaled graphs with picking legend (matplotlib)?

☆樱花仙子☆ 提交于 2021-02-20 04:06:20
问题 I am working on a picking legend with matplotlib. The goal is to hide and shows curves, by clicking on the legend. I found this solution (Hiding lines after showing a pyplot figure), which works very well. I want improve this code to adapt automatically the axis after each clic on the legend. I don't know if it is possible. Do you have any hint? Their is an example of what I want on the images below. First of all, the Image 1 represents the graph. Then after clicking on the legend 5*sin(x),

How can I plot subplots with nested plot arrowed at a specific point?

只谈情不闲聊 提交于 2021-02-20 04:05:40
问题 I saw this chart in a paper and need to reproduce it. How can I plot a figure like this in Python? Note that: I suspect bigger subplots are perhaps drawn using seaborn or using matplotlib's subplot The smaller plots are POINTING at a specific part of the curve in the bigger plots. 回答1: One strategy can be using mpl_toolkits.axes_grid1.inset_locator , as suggested in the answer to this question: How to overlay one pyplot figure on another I have made a quick example: import matplotlib.pyplot

python 1/x plot scale formatting, tick position

≯℡__Kan透↙ 提交于 2021-02-20 03:47:28
问题 I have plotted some data with Python and tried to change the ticks with FuncFormatter . Now I want to change the segmentation into round numbers. I also want minor ticks in the same formation, in my case it would be a 1/x segmentation. I want the scaling to spread. The pictures will help you to imagine my issue. import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as tick x = np.array([805.92055,978.82006,564.88627,813.70311,605.73361,263.27184,169.40317]) y = np.array(