gridlines

Matplotlib add gridlines not working as expected

二次信任 提交于 2021-01-29 15:41:53
问题 Using matplotlib subplots() in Jupyter Notebook, and using "seaborn-whitegrid" plot.style() . I am trying to add minor gridlines to my x-axis, which is in log. What am I missing? import matplotlib.pyplot as plt %matplotlib inline plt.style.use('seaborn-whitegrid') x, y = [(1, 9, 65, 142, 330), (0, 0.16, 0.50, 0.84, 1)] fig, axes = plt.subplots(3,5, figsize=(8.5,5.5), constrained_layout=True) #counter = 0 for ax in axes.flat: ax.plot(x,y) ax.set_title('Dataset-A', fontsize=8) ax.set_xlabel('x'

How to set curvilinear lat lon gridline labels parallel to gridlines with cartopy?

空扰寡人 提交于 2021-01-29 09:40:55
问题 Description Is there a method available (or under consideration) to orient the lat lon gridline labels parallel to the gridlines as they intersect the plot boundary? Something like the labels seen in this plot. There seems to be an automated logic in place for orienting gridline labels as follows: Cartopy version 0.18.0b1 Code import matplotlib.pyplot as plt import cartopy.crs as ccrs rotated_crs = ccrs.RotatedPole(pole_longitude=120.0, pole_latitude=70.0) ax = plt.axes(projection=rotated_crs

Google Visualization highlight single grid line

▼魔方 西西 提交于 2020-01-14 14:05:59
问题 how can I highlight a single grid line? I would like to set an optical temperature limit at 35 ° C. Thanks! I have now added it to my code, but it does not work .... do you see my mistake? Or did I not understand something in your explanation? Here is the edited version : //Google Chart google.charts.load('current', { callback: function drawChart(peanut) { const div = document.createElement('div'); div.id = peanut.color + peanut.mac.split(':').join(''); $('#charts').appendChild(div); peanut

Google Visualization highlight single grid line

别说谁变了你拦得住时间么 提交于 2020-01-14 14:04:29
问题 how can I highlight a single grid line? I would like to set an optical temperature limit at 35 ° C. Thanks! I have now added it to my code, but it does not work .... do you see my mistake? Or did I not understand something in your explanation? Here is the edited version : //Google Chart google.charts.load('current', { callback: function drawChart(peanut) { const div = document.createElement('div'); div.id = peanut.color + peanut.mac.split(':').join(''); $('#charts').appendChild(div); peanut

Google Visualization highlight single grid line

末鹿安然 提交于 2020-01-14 14:04:22
问题 how can I highlight a single grid line? I would like to set an optical temperature limit at 35 ° C. Thanks! I have now added it to my code, but it does not work .... do you see my mistake? Or did I not understand something in your explanation? Here is the edited version : //Google Chart google.charts.load('current', { callback: function drawChart(peanut) { const div = document.createElement('div'); div.id = peanut.color + peanut.mac.split(':').join(''); $('#charts').appendChild(div); peanut

Align grid with ticks

£可爱£侵袭症+ 提交于 2020-01-06 20:36:26
问题 When I let plot draw the axis, grid aligns with ticks by default. However, my plot is somewhat involved: mytime <- as.POSIXct("2015-08-20") + seq(0,by=3600,length.out=7*24) plot(x=mytime,y=rnorm(7*24),xaxt="n") ticks <- mytime[seq(1,by=12,to=length(mytime))] axis(1, ticks, strftime(ticks, "%a %H:%M")) grid(ny=NULL,nx=14) and I cannot get the grid to align with the ticks : How do I make them align? 回答1: Looks like abline is the answer: mytime <- as.POSIXct("2015-08-20") + seq(0,by=3600,length

Reduce number of gridlines in plotly scatter plots with log scale in R shiny

孤街浪徒 提交于 2020-01-02 19:14:45
问题 I've build the following test app where I solve the issue to get the tick labels as scientific annotation, but I would now like to reduce the number of grid lines to only be placed at the "main" ticks, i.e. the ones that have a text label. This question was posted based on discussion / comment on this previous SO question I would like to find a way that works for both 2D and 3D plotly scatter plots since I am using both. Here is the 3D app. library(shiny) library(plotly) shinyApp( ui =

How do I align date and values to gridlines in Google Chart?

霸气de小男生 提交于 2019-12-28 04:31:11
问题 I'm using Google Chart in my application with the following code (JSFiddle): google.load('visualization', '1', {packages: ['corechart']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('date', 'date'); data.addColumn('number', 'view'); data.addRows([ [new Date('2015-08-01'), 5], [new Date('2015-08-02'), 7], [new Date('2015-08-03'), 2], [new Date('2015-08-04'), 16], [new Date('2015-08-05'), 3], [new Date('2015-08-06'

In matplotlib, Is there a way to set gridlines below bars/lines/patches while retaining ticklabels above?

不想你离开。 提交于 2019-12-24 04:12:30
问题 Related to Matplotlib: draw grid lines behind other graph elements, but nothing there worked for me. I have the following plot where I want to hide the gridlines under the red line while retaining the labels on top of the red line: import numpy as np import matplotlib.pyplot as plt #plot r = np.arange(0, 3.0, 0.01) theta = 2 * np.pi * r ax = plt.subplot(111, polar=True) ax.plot(theta, r, color='r', linewidth=20) ax.set_rmax(2.0) ax.grid(True, lw=2) #set labels label_pos = np.linspace(0.0, 2 *

How to make dashed grid lines intersect making crosshairs in gnuplot?

空扰寡人 提交于 2019-12-24 00:29:16
问题 I'm plotting some data and I want to use dashed grid lines. Any dashed grid line would suffice, but I prefer a "long dash, short dash, long dash" format. For example, given the following code set grid lc rgb "#000000" lt 1 dt (50, 25, 20, 25) plot x**2 I get this result But I would rather the grid lines intersection to happen always at the middle of two dashes, like this If I could make horizontal grid lines different to vertical grid lines and I could add some offset to each one, then I'd